#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  char input[2][101];
  cin >> input[0] >> input[1];
  int n = strlen(input[0]);
  int ans = 0;
  int quarce = 0;
  for (int i = 0; i < n; i++) {
    int cur = (input[0][i] == '0') + (input[1][i] == '0');
    quarce += cur;
    if (quarce >= 3) {
      quarce -= 3;
      ans++;
    } else
      quarce = cur;
  }
  cout << ans;
  return 0;
}
