#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0;
  string s[2];
  cin >> s[0] >> s[1];
  string a = "00", b = "X0", c = "0X";
  for (int i = 0; i < s[0].length() - 1; i++) {
    string num = s[0].substr(i, 2), den = s[1].substr(i, 2);
    if (num == a && den == a) {
      s[1][i + 1] = 'X';
      ans++;
    } else if (num == a && (den == b || den == c)) {
      ans++;
      i++;
    } else if ((num == b || num == c) && den == a) {
      ans++;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}
