#include <bits/stdc++.h>
using namespace std;
string s[5];
int ans, ar[200];
int main() {
  cin >> s[1] >> s[2];
  int sl = s[1].length();
  for (int i = 1; i <= 2; i++)
    for (int j = 0; j < sl; j++) {
      if (s[i][j] == 'X') ar[j]++;
    }
  for (int i = 0; i < sl - 1; i++) {
    if (ar[i] + ar[i + 1] <= 1) {
      ans++;
      ar[i + 1]++;
      if (ar[i] == 1) ar[i + 1] = 2;
    }
  }
  cout << ans << "\n";
}
