#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX;
const long long base = 1e9;
const double PI = acos(-1);
const long long MOD = 1e9 + 7;
const long long N = 1e5 + 10;
void solve();
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
void solve() {
  string s[2];
  cin >> s[0] >> s[1];
  long long n = s[0].size(), ans = 0;
  for (long long i = 0; i < n; ++i) {
    if ((s[0][i] == '0' and s[1][i] == 'X') or
        (s[0][i] == 'X' and s[1][i] == '0')) {
      if (i + 1 < n and s[0][i + 1] == '0' and s[1][i + 1] == '0') {
        ++ans;
        ++i;
      }
    } else if (s[0][i] == '0' and s[1][i] == '0') {
      if (i + 2 < n and s[0][i + 1] == '0' and s[1][i + 1] == '0' and
          s[0][i + 2] == '0' and s[1][i + 2] == '0') {
        ans += 2;
        i += 2;
        continue;
      }
      if (i + 1 < n and (s[0][i + 1] == '0' or s[1][i + 1] == '0')) {
        ++ans;
        ++i;
      }
    }
  }
  cout << ans << "\n";
  return;
}
