#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
int main() {
  string s[2];
  cin >> s[0] >> s[1];
  int n = s[0].size();
  int ret = 0;
  for (int i = 0; i < n; ++i) {
    if (s[0][i] == '0' && s[1][i] == '0') {
      if (i + 1 < n && s[0][i + 1] == '0') {
        ++ret;
        s[0][i + 1] = 'X';
      } else if (i + 1 < n && s[1][i + 1] == '0') {
        ++ret;
        s[1][i + 1] = 'X';
      }
    } else if (s[0][i] == '0') {
      if (i + 1 < n && s[0][i + 1] == '0' && s[1][i + 1] == '0') {
        ++ret;
        s[0][i + 1] = s[1][i + 1] = 'X';
      }
    } else if (s[1][i] == '0') {
      if (i + 1 < n && s[0][i + 1] == '0' && s[1][i + 1] == '0') {
        ++ret;
        s[0][i + 1] = s[1][i + 1] = 'X';
      }
    }
  }
  cout << ret << endl;
  return 0;
}
