#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s[2];
  int i, j, n, mx, ct = 0, l[] = {0, 0};
  cin >> s[0] >> s[1];
  n = s[0].size();
  if (s[0][0] == 'X') l[0] = 1;
  if (s[1][0] == 'X') l[1] = 1;
  for (i = 1; i < n; i++) {
    int c[] = {0, 0};
    if (s[0][i] == 'X') c[0] = 1;
    if (s[1][i] == 'X') c[1] = 1;
    if (l[0] + l[1] == 2 || c[0] + c[1] == 2) {
      l[0] = c[0];
      l[1] = c[1];
    } else if ((l[0] + l[1] == 1 && c[0] + c[1] == 0) ||
               (l[0] + l[1] == 0 && c[0] + c[1] == 1)) {
      l[0] = l[1] = 1;
      ct++;
    } else if (l[0] + l[1] == 0 && c[0] + c[1] == 0) {
      l[0] = 1;
      l[1] = 0;
      ct++;
    }
  }
  cout << ct << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  while (t--) solve();
}
