#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, i, j, k, l;
  string s1, s2;
  cin >> s1 >> s2;
  int ans = 0;
  for (i = 0; i < s1.length(); i++) {
    if (s1[i] == '0' && s2[i] == '0') {
      if (s1[i - 1] == '0') {
        ans++;
        s1[i - 1] = 'X';
        s1[i] = 'X';
        s2[i] = 'X';
      } else if (s2[i - 1] == '0') {
        ans++, s2[i - 1] = 'X';
        s1[i] = 'X';
        s2[i] = 'X';
      } else if (s1[i + 1] == '0') {
        ans++, s1[i + 1] = 'X';
        s1[i] = 'X';
        s2[i] = 'X';
      } else if (s2[i + 1] == '0') {
        ans++, s2[i + 1] = 'X';
        s1[i] = 'X';
        s2[i] = 'X';
      }
    }
  }
  cout << ans;
}
