#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[2];
  long long m;
  cin >> s[0];
  cin >> s[1];
  m = s[1].size();
  long long i, ans = 0, prev = 0, cur;
  for (i = 0; i < m; i++) {
    cur = (s[0][i] == '0') + (s[1][i] == '0');
    if (cur == 0) prev = 0;
    if (cur == 1) {
      if (prev == 2) {
        ans++;
        prev = 0;
      } else
        prev = 1;
    }
    if (cur == 2) {
      if (prev > 0) {
        ans++;
        if (prev == 2)
          prev = 1;
        else
          prev = 0;
      } else
        prev = 2;
    }
  }
  cout << ans;
  return 0;
}
