#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long powM(long long x, long long y, long long m) {
  if (y == 0) return 1;
  long long p = powM(x, y / 2, m) % m;
  p = (p * p) % m;
  return (y % 2 == 0) ? p : (x * p) % m;
}
int main() {
  string s[2];
  cin >> s[0] >> s[1];
  int prev = 0, ans = 0;
  ;
  for (long long i = 1; i <= (int)s[0].length() - 1; i++) {
    int cnt = 0;
    for (long long j = i - 1; j <= i; j++) {
      if (s[0][j] == 'X') cnt++;
      if (s[1][j] == 'X') cnt++;
    }
    cnt += prev;
    if (cnt >= 2) {
      prev = 0;
    }
    if (cnt == 1) {
      ans++;
      prev = 2;
    }
    if (cnt == 0) {
      ans++;
      prev = 1;
    }
  }
  cout << ans << endl;
  return 0;
}
