#include <bits/stdc++.h>
using namespace std;
const int inf = 105;
char s[2][inf];
int f[inf][4];
int a[2][inf];
int n;
int main() {
  scanf("%s%s", s[0] + 1, s[1] + 1);
  n = strlen(s[0] + 1);
  for (int i = 0; i <= 1; i++)
    for (int j = 1; j <= n; j++) a[i][j] = s[i][j] == 'X';
  memset(f, -1, sizeof(f));
  f[0][3] = 0;
  for (int i = 0; i < n; i++) {
    int u = a[0][i + 1] * 2 + a[1][i + 1];
    for (int j = 0; j < 4; j++) {
      if (f[i][j] == -1) continue;
      f[i + 1][u] = max(f[i + 1][u], f[i][j]);
      if (!j) {
        if (!(u & 2)) f[i + 1][u | 2] = max(f[i + 1][u | 2], f[i][j] + 1);
        if (!(u & 1)) f[i + 1][u | 1] = max(f[i + 1][u | 1], f[i][j] + 1);
      }
      if (!u) {
        if (j != 3) f[i + 1][3] = max(f[i + 1][3], f[i][j] + 1);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 4; i++) ans = max(ans, f[n][i]);
  printf("%d\n", ans);
  return 0;
}
