#include <bits/stdc++.h>
using namespace std;
void debug(int n, ...) {
  va_list v1;
  va_start(v1, n);
  for (int i = 0; i < n; i++) {
    int val = va_arg(v1, int);
    printf("%d ", val);
  }
  va_end(v1);
  cout << endl;
}
int main() {
  string s[2];
  cin >> s[0];
  cin >> s[1];
  int n = s[0].size();
  int sayac = 0;
  for (int i = 0; i < n; i++) {
    if (s[0][i] == '0') {
      if (s[1][i] == '0') {
        if (i > 0 && s[0][i - 1] == '0') {
          sayac++;
          s[0][i - 1] = s[1][i] = s[0][i] = 'X';
          continue;
        }
        if (i > 0 && s[1][i - 1] == '0') {
          sayac++;
          s[1][i - 1] = s[1][i] = s[0][i] = 'X';
          continue;
        }
        if (s[0][i + 1] == '0') {
          sayac++;
          s[0][i + 1] = s[1][i] = s[0][i] = 'X';
          continue;
        }
        if (s[1][i + 1] == '0') {
          sayac++;
          s[1][i + 1] = s[1][i] = s[0][i] = 'X';
          continue;
        }
      }
    }
  }
  cout << sayac;
  return 0;
}
