#include <bits/stdc++.h>
using namespace std;
double pi = acos(-1.0);
int n, ans;
string s[3];
int main() {
  cin >> s[1] >> s[2];
  n = s[1].size();
  for (int i = 0; i < n - 1; i++)
    if (s[1][i] == '0' && s[2][i] == '0') {
      if (s[1][i + 1] == '0')
        s[1][i] = s[2][i] = s[1][i + 1] = 'X', ans++;
      else if (s[2][i + 1] == '0')
        s[1][i] = s[2][i] = s[2][i + 1] = 'X', ans++;
    } else if (s[1][i] == '0' && s[1][i + 1] == '0' && s[2][i + 1] == '0') {
      s[1][i] = s[1][i + 1] = s[2][i + 1] = 'X';
      ans++;
    } else if (s[2][i] == '0' && s[1][i + 1] == '0' && s[2][i + 1] == '0') {
      s[2][i] = s[1][i + 1] = s[2][i + 1] = 'X';
      ans++;
    }
  cout << ans;
}
