#include <bits/stdc++.h>
using namespace std;
string arr[3];
int n;
bool check1(int i) {
  if (i == n - 1) return 0;
  if (arr[0][i] == 'X' || arr[1][i] == 'X' || arr[1][i + 1] == 'X') return 0;
  arr[0][i] = arr[1][i] = arr[1][i + 1] = 'X';
  return 1;
}
bool check2(int i) {
  if (i == n - 1) return 0;
  if (arr[0][i] == 'X' || arr[1][i] == 'X' || arr[0][i + 1] == 'X') return 0;
  arr[0][i] = arr[1][i] = arr[0][i + 1] = 'X';
  return 1;
}
bool check3(int i) {
  if (arr[0][i] == 'X' || arr[0][i - 1] == 'X' || arr[1][i] == 'X') return 0;
  arr[0][i] = arr[0][i - 1] = arr[1][i] = 'X';
  return 1;
}
bool check4(int i) {
  if (arr[0][i] == 'X' || arr[1][i] == 'X' || arr[1][i - 1] == 'X') return 0;
  arr[0][i] = arr[1][i] = arr[1][i - 1] = 'X';
  return 1;
}
int main() {
  cin >> arr[0] >> arr[1];
  n = arr[0].size();
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (arr[0][i] == 'X')
      continue;
    else {
      if (i == 0) {
        if (check1(i)) {
          ans++;
          continue;
        }
        if (check2(i)) {
          ans++;
          continue;
        }
      } else {
        if (check3(i)) {
          ans++;
          continue;
        }
        if (check4(i)) {
          ans++;
          continue;
        }
        if (check1(i)) {
          ans++;
          continue;
        }
        if (check2(i)) ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
