#include <bits/stdc++.h>
using namespace std;
long long int fast_exp(long long int base, long long int exp) {
  long long int res = 1;
  while (exp > 0) {
    if (exp & 1) res = (res * base) % 1000000007;
    base = (base * base) % 1000000007;
    exp /= 2;
  }
  return res % 1000000007;
}
long long int pr[1000001] = {0};
void isprime() {
  pr[0] = 1;
  pr[1] = 1;
  for (long long int a = 2; a < 1000001; a++) {
    if (!pr[a]) {
      for (long long int b = 2 * a; b < 1000001; b += a) {
        pr[b] = 1;
      }
    }
  }
}
bool sortsec(const pair<long long int, long long int>& a,
             const pair<long long int, long long int>& b) {
  return (a.second > b.second);
}
bool sortcol(const vector<long long int>& v1, const vector<long long int>& v2) {
  return v1[1] > v2[1];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s[2];
  cin >> s[0] >> s[1];
  long long int n = s[0].length();
  long long int ans = 0;
  for (long long int a = 0; a < n;) {
    if (a <= n - 3) {
      if (s[0][a] == '0' && s[0][a + 1] == '0' && s[0][a + 2] == '0' &&
          s[1][a] == '0' && s[1][a + 1] == '0' && s[1][a + 2] == '0') {
        ans += 2;
        a += 3;
        continue;
      }
    }
    if (s[0][a] == '0' && s[0][a + 1] == '0' &&
        (s[1][a] == '0' || s[1][a + 1] == '0')) {
      ans++;
      a += 2;
    } else if (s[1][a] == '0' && s[1][a + 1] == '0' &&
               (s[0][a] == '0' || s[0][a + 1] == '0')) {
      ans++;
      a += 2;
    } else {
      a++;
    }
  }
  cout << ans << endl;
  return 0;
}
