#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v(2);
  cin >> v[0] >> v[1];
  int ans = 0;
  for (int i = 0; i < 1; i++) {
    for (int j = 0; j < v[i].size(); j++) {
      if (i + 1 < 2 && j + 1 < v[i].size() && v[i][j + 1] == '0' &&
          v[i + 1][j] == '0' && v[i][j] == '0') {
        v[i][j] = 'x';
        v[i][j + 1] = 'x';
        v[i + 1][j] = 'x';
        ans++;
      }
      if (i + 1 < 2 && j + 1 < v[i].size() && v[i + 1][j] == '0' &&
          v[i + 1][j + 1] == '0' && v[i][j] == '0') {
        v[i][j] = 'x';
        v[i + 1][j + 1] = 'x';
        v[i + 1][j] = 'x';
        ans++;
      }
      if (i + 1 < 2 && j + 1 < v[i].size() && v[i + 1][j + 1] == '0' &&
          v[i][j + 1] == '0' && v[i][j] == '0') {
        v[i][j] = 'x';
        v[i][j + 1] = 'x';
        v[i + 1][j + 1] = 'x';
        ans++;
      }
      if (i + 1 < 2 && j + 1 < v[i].size() && v[i + 1][j + 1] == '0' &&
          v[i + 1][j] == '0' && v[i][j + 1] == '0') {
        v[i + 1][j] = 'x';
        v[i][j + 1] = 'x';
        v[i + 1][j + 1] = 'x';
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
