#include <bits/stdc++.h>
using namespace std;
int x8[] = {1, 1, 1, 0, 0, -1, -1, -1};
int y8[] = {1, 0, -1, 1, -1, -1, 0, -1};
int x4[] = {1, -1, 0, 0};
int y4[] = {0, 0, 1, -1};
long long int mod = 1e9 + 7;
int n;
string s[2];
bool check(int i, int j) {
  if (i >= 0 && i <= 1 && j >= 0 && j < n && s[i][j] == '0') {
    return true;
  }
  return false;
}
void getac() {
  cin >> s[0] >> s[1];
  int c = 0;
  n = s[0].length();
  int i = 0;
  for (int j = 0; j < n; j++) {
    if (check(i, j) && check(i + 1, j) && check(i + 1, j - 1)) {
      s[i][j] = 'x';
      s[i + 1][j] = 'x';
      s[i + 1][j - 1] = 'x';
      c++;
    } else if (check(i, j) && check(i + 1, j) && check(i, j + 1)) {
      s[i][j] = 'x';
      c++;
      s[i + 1][j] = 'x';
      s[i][j + 1] = 'x';
    } else if (check(i, j) && check(i + 1, j) && check(i, j + 1)) {
      s[i][j] = 'x';
      s[i + 1][j] = 'x';
      s[i + 1][j + 1] = 'x';
      c++;
    } else if (check(i, j) && check(i, j + 1) && check(i + 1, j + 1)) {
      s[i][j] = 'x';
      s[i][j + 1] = 'x';
      c++;
      s[i + 1][j + 1] = 'x';
    } else if (check(i, j) && check(i + 1, j) && check(i + 1, j + 1)) {
      s[i][j] = 'x';
      s[i + 1][j] = 'x';
      s[i + 1][j + 1] = 'x';
      c++;
    }
  }
  cout << c;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  t = 1;
  while (t--) {
    getac();
  }
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}
