#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    string a, b;
    long long i, ans = 0;
    cin >> a >> b;
    long long pre = 0;
    for (i = 0; i < a.size(); i++) {
      long long cur = (a[i] == '0') + (b[i] == '0');
      if (cur == 0) {
        pre = 0;
      } else if (cur == 1) {
        if (pre == 2) {
          ans++;
          pre = 0;
        } else
          pre = 1;
      } else {
        if (pre == 2) {
          ans++;
          pre = 1;
        } else if (pre == 1) {
          ans++;
          pre = 0;
        } else
          pre = 2;
      }
    }
    cout << ans;
  }
  return 0;
}
