#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int gakki = 5 + 2 + 1 + 19880611 + 1e9;
const int MAXN = 3e5 + 5, MAXM = 6e6 + 5;
char f[3][105];
char s[3][105];
string ch[3];
int n;
int ans = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 1; i <= 2; i++) {
    cin >> ch[i];
    n = ch[i].size();
    for (int j = 0; j < n; j++) {
      f[i][j + 1] = ch[i][j];
    }
  }
  for (int i = 1; i <= 2; i++) {
    for (int j = 1; j <= n; j++) {
      s[i][j] = f[i][j];
    }
  }
  int sumnow;
  for (int i = 1; i <= n - 1; i++) {
    sumnow = 0;
    for (int j = 1; j <= 2; j++) {
      for (int k = i; k <= i + 1; k++) {
        if (s[j][k] == '0') {
          sumnow++;
        }
      }
    }
    if (sumnow >= 3) {
      ans++;
      for (int j = 1; j <= 2; j++) {
        for (int k = i; k <= i + 1; k++) {
          if (s[j][k] == '0') {
            s[j][k] = 'X';
          }
        }
      }
      if (sumnow == 4) {
        s[2][i + 1] = '0';
      }
    }
  }
  cout << ans << endl;
  return 0;
}
