#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 100;
char s[2][200];
int main() {
  cin >> s[0] >> s[1];
  int len = strlen(s[0]);
  int ans = 0;
  for (int i = 0; i < len; ++i) {
    if (s[0][i] == '0' && s[1][i] == '0') {
      if (i > 0 && (s[0][i - 1] == '0' || s[1][i - 1] == '0')) {
        s[0][i] = s[1][i] = 'X';
        ++ans;
      } else if (i + 1 < len && s[0][i + 1] == '0') {
        ++ans;
        s[0][i + 1] = 'X';
      } else if (i + 1 < len && s[1][i + 1] == '0') {
        ++ans;
        s[1][i + 1] = 'X';
      }
    }
  }
  cout << ans << endl;
  return 0;
}
