#include <bits/stdc++.h>
using namespace std;
const int MAX_ROW_SIZE = 100 + 7;
const int firstCol[] = {11, 10, 01, 11, 11};
const int secondCol[] = {10, 11, 11, 01, 11};
const int firstRC[] = {00, 00, 00, 00, 01};
const int secondRC[] = {00, 00, 00, 00, 00};
int board[MAX_ROW_SIZE], boardLength, dp[MAX_ROW_SIZE];
char getRow[MAX_ROW_SIZE];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin.getline(getRow, sizeof(getRow));
  boardLength = strlen(getRow);
  for (int i = 0; i < boardLength; ++i)
    board[i] = board[i] * 10 + !(getRow[i] - '0');
  cin.getline(getRow, sizeof(getRow));
  for (int i = 0; i < boardLength; ++i)
    board[i] = board[i] * 10 + !(getRow[i] - '0');
  int bishwock = 0;
  for (int i = 1; i < boardLength; ++i)
    for (int j = 0; j < 5; ++j)
      if (board[i] == firstCol[j] && board[i - 1] == secondCol[j]) {
        board[i] = firstRC[j];
        board[i - 1] = secondRC[j];
        ++bishwock;
        break;
      }
  cout << bishwock << "\n";
  return 0;
}
