#include <bits/stdc++.h>
using namespace std;
map<vector<string>, bool> valid = {{{"X0", "00"}, 1},
                                   {{"0X", "00"}, 1},
                                   {{"00", "X0"}, 1},
                                   {{"00", "0X"}, 1},
                                   {{"00", "00"}, 1}};
map<vector<string>, int> type = {{{"X0", "00"}, 0},
                                 {{"0X", "00"}, 1},
                                 {{"00", "X0"}, 2},
                                 {{"00", "0X"}, 3},
                                 {{"00", "00"}, 4}};
int main() {
  string s[2];
  cin >> s[0] >> s[1];
  int ans = 0;
  for (long long i = 0; i < s[0].size() - 1; ++i) {
    vector<string> tmp;
    string junk;
    for (long long j = 0; j < 2; ++j) {
      for (long long k = i; k < i + 2; ++k) {
        junk.push_back(s[j][k]);
      }
      tmp.push_back(junk);
      junk = "";
    }
    if (valid[tmp]) {
      int tp = type[tmp];
      if (tp < 4) {
        for (long long j = 0; j < 2; ++j) {
          for (long long k = i; k < i + 2; ++k) {
            s[j][k] = 'X';
          }
        }
      } else {
        s[0][i] = s[1][i] = s[1][i + 1] = 'X';
      }
      ++ans;
    }
  }
  cerr << s[0] << endl << s[1] << endl;
  cout << ans << endl;
  return 0;
}
