#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
template <typename T>
string ts(T v) {
  string res = "{";
  bool r = true;
  for (const auto &x : v) {
    if (!r) res += ",";
    r = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
bool done[2][101];
void solve() {
  string a, b;
  cin >> a >> b;
  int n = a.size();
  int ans = 0, cur = 0, e = 0;
  for (int i = 0; i < int(n); i++) {
    cur = (a[i] == '0') + (b[i] == '0');
    e += cur;
    if (e >= 3) {
      e -= 3;
      ans++;
    } else {
      e = cur;
    }
  }
  cout << ans << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
