#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
bool used[2][103];
int main() {
  ios::sync_with_stdio(false);
  int n;
  for (int y = 0; y < 2; y++) {
    string s;
    cin >> s;
    n = s.length();
    for (int x = 0; x < n; x++) used[y][x] = s[x] == 'X';
  }
  int result = 0;
  for (int i = 0; i < n - 1; i++) {
    if (!used[0][i] && !used[1][i] && (!used[0][i + 1] || !used[1][i + 1])) {
      used[0][i] = true;
      used[1][i] = true;
      result++;
      if (!used[0][i + 1])
        used[0][i + 1] = true;
      else
        used[1][i + 1] = true;
    } else if (!used[0][i + 1] && !used[1][i + 1] &&
               (!used[0][i] || !used[1][i])) {
      used[0][i + 1] = true;
      used[1][i + 1] = true;
      result++;
      if (!used[0][i])
        used[0][i] = true;
      else
        used[1][i] = true;
    }
  }
  cout << result << endl;
}
