#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void solve() {
  vector<string> s(2);
  for (int i = 0; i < (2); ++i) cin >> s[i];
  int n = s[0].size();
  int ans = 0, b = 0;
  for (int i = 0; i < (n); ++i) {
    int cnt = (s[0][i] == '0') + (s[1][i] == '0');
    switch (cnt) {
      case 0:
        b = 0;
        break;
      case 1:
        if (b == 2) {
          b = 0;
          ++ans;
        } else {
          b = 1;
        }
        break;
      case 2:
        if (b == 0)
          b = 2;
        else if (b == 1) {
          b = 0;
          ++ans;
        } else {
          b = 1;
          ++ans;
        }
      default:
        break;
    }
  }
  cout << ans << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
