#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const double pi = acos(-1);
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
string a[2];
int solve() {
  int n = (int)a[0].size(), cnt = 0, ret = 0, ones = 0;
  for (int j = 0; j < n; ++j) {
    if (a[0][j] == '0' && a[1][j] == '0') {
      ++cnt;
      if (ones) ret++, cnt--;
      ones = 0;
    } else if (a[0][j] == 'X' && a[1][j] == 'X') {
      if (cnt == 2)
        ret++;
      else if (cnt >= 3) {
        ret += ((cnt / 3) * 2);
        cnt %= 3;
        if (cnt == 2) ret++;
      }
      cnt = 0;
      ones = 0;
    } else {
      if (ones) ones = 0;
      if (cnt == 1) {
        ret++;
      } else if (cnt == 2) {
        ret++, ones++;
      } else if (cnt >= 3) {
        ret += ((cnt / 3) * 2);
        cnt %= 3;
        if (cnt == 1)
          ret++;
        else if (cnt == 2)
          ret++, ones++;
        else
          ones++;
      } else
        ones++;
      cnt = 0;
    }
  }
  ret += ((cnt / 3) * 2);
  cnt %= 3;
  if (cnt == 2) ret++;
  return ret;
}
int main() {
  for (int i = 0; i < 2; ++i) cin >> a[i];
  cout << solve() << endl;
}
