#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const long long inf = 0x3f3f3f3f3f3f3f3fll;
using namespace std;
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  string s[2];
  cin >> s[0] >> s[1];
  long long count = 0, i;
  for (i = 0; i < s[0].length(); i++) {
    if (s[0][i] == '0' && s[1][i] == '0') {
      if (s[0][i + 1] == '0' || s[1][i + 1] == '0') {
        if (s[0][i + 1] == '0')
          s[0][i + 1] = 'A';
        else if (s[1][i + 1] == '0')
          s[1][i + 1] = 'A';
        s[0][i] = s[1][i] = 'A';
        count++;
      }
    } else if (s[0][i] == '0' || s[1][i] == '0') {
      if (s[0][i + 1] == '0' && s[1][i + 1] == '0') {
        if (s[0][i] == '0') s[0][i] = 'A';
        if (s[1][i] == '0') s[1][i] = 'A';
        s[0][i + 1] = s[1][i + 1] = 'A';
        count++;
      }
    }
  }
  cout << count << endl;
  return 0;
}
