#include <bits/stdc++.h>
using namespace std;
long long modulo(long long base, long long exp, long long m);
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int cnt = 0;
  vector<int> flag(s1.size() + 1, 0);
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '0' && s2[i] == '0' && s2[i + 1] == '0') {
      cnt++;
      s1[i] = 'X';
      s2[i] = 'X';
      s2[i + 1] = 'X';
    } else if (s2[i] == '0' && s1[i + 1] == '0' && s2[i + 1] == '0') {
      cnt++;
      s2[i] = 'X';
      s1[i + 1] = 'X';
      s2[i + 1] = 'X';
    } else if (s1[i] == '0' && s2[i] == '0' && s1[i + 1] == '0') {
      cnt++;
      s1[i] = 'X';
      s2[i] = 'X';
      s1[i + 1] = 'X';
    } else if (s1[i] == '0' && s1[i + 1] == '0' && s2[i + 1] == '0') {
      cnt++;
      s1[i] = 'X';
      s1[i + 1] = 'X';
      s2[i + 1] = 'X';
    }
  }
  cout << cnt;
  return 0;
}
long long modulo(long long base, long long exp, long long m) {
  long long answer = 1;
  while (exp > 0) {
    if (exp % 2 == 1) answer = (answer * base) % m;
    exp = exp / 2;
    base = (base * base) % m;
  }
  return answer;
}
