#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return power((a * a) % 1000000007, b / 2);
  else
    return ((a % 1000000007) * power((a * a) % 1000000007, (b - 1) / 2) %
            1000000007) %
           1000000007;
}
long long int isPrime(long long int x) {
  long long int i, flag = 1;
  if (x == 0 || x == 1) flag = 0;
  for (i = 2; i <= sqrt(x); i++) {
    if (x % i == 0) {
      flag = 0;
      break;
    }
  }
  return flag;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  ;
  string s[2];
  cin >> s[0];
  cin >> s[1];
  int n = s[0].size();
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[0][i] == '0' and s[1][i] == '0' and s[1][i + 1] == '0') {
      ans++;
      s[0][i] = 'X';
      s[1][i] = 'X';
      s[1][i + 1] = 'X';
    }
    if (s[0][i] == '0' and s[1][i] == '0' and s[0][i + 1] == '0') {
      ans++;
      s[0][i] = 'X';
      s[1][i] = 'X';
      s[0][i + 1] = 'X';
    }
    if (s[0][i] == '0' and s[0][i + 1] == '0' and s[1][i + 1] == '0') {
      ans++;
      s[0][i] = 'X';
      s[0][i + 1] = 'X';
      s[1][i + 1] = 'X';
    }
    if (s[1][i] == '0' and s[1][i + 1] == '0' and s[0][i + 1] == '0') {
      ans++;
      s[1][i] = 'X';
      s[1][i + 1] = 'X';
      s[0][i + 1] = 'X';
    }
  }
  cout << ans << '\n';
  return 0;
}
