#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
const double oula = 0.57721566490153286060651209;
using namespace std;
int book[5][105];
int len;
string s1, s2;
bool Check(int x) {
  if (x - 1 >= 0) {
    if (!book[0][x] && !book[1][x - 1] && !book[1][x] && s1[x] == '0' &&
        s2[x - 1] == '0' && s2[x] == '0') {
      book[0][x] = 1;
      book[1][x - 1] = 1;
      book[1][x] = 1;
      return true;
    }
  }
  if (x + 1 < len) {
    if (!book[0][x] && !book[1][x + 1] && !book[1][x] && s1[x] == '0' &&
        s2[x + 1] == '0' && s2[x] == '0') {
      book[0][x] = 1;
      book[1][x + 1] = 1;
      book[1][x] = 1;
      return true;
    }
    if (!book[0][x] && !book[0][x + 1] && !book[1][x + 1] && s1[x] == '0' &&
        s1[x + 1] == '0' && s2[x + 1] == '0') {
      book[0][x] = 1;
      book[0][x + 1] = 1;
      book[1][x + 1] = 1;
      return true;
    }
    if (!book[0][x] && !book[0][x + 1] && !book[1][x] && s1[x] == '0' &&
        s1[x + 1] == '0' && s2[x] == '0') {
      book[0][x] = 1;
      book[0][x + 1] = 1;
      book[1][x] = 1;
      return true;
    }
  }
  return false;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> s1 >> s2;
  len = s1.length();
  int ans = 0;
  for (int i = 0; i < len; i++) {
    if (!book[0][i]) {
      if (Check(i)) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
