#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
string second[2];
void Input() { cin >> second[0] >> second[1]; }
void Solve() {
  long long e = 0, ans = 0, c = 0, n = second[0].size();
  for (long long i = 0; i < n; i++) {
    c = (second[0][i] == '0') + (second[1][i] == '0');
    e += c;
    if (e >= 3)
      e -= 3, ans++;
    else
      e = c;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  while (T--) {
    Input();
    Solve();
  }
  return 0;
}
