#include <bits/stdc++.h>
using namespace std;
const int N = 110;
bool vis[N][2][2];
int n, mem[N][2][2], inf = 1e9;
char A[3][N], a[3][N];
int dp(int i, bool q1, bool q2) {
  if (i == n + 1) return (q1 | q2) ? -inf : 0;
  int &ret = mem[i][q1][q2];
  if (vis[i][q1][q2]) return ret;
  vis[i][q1][q2] = 1;
  if ((q1 && a[1][i] == 'X') || (q2 && a[2][i] == 'X')) return ret = -inf;
  bool cell1 = (a[1][i] == 'X') | q1;
  bool cell2 = (a[2][i] == 'X') | q2;
  ret = dp(i + 1, 0, 0);
  if (!cell1) ret = max(ret, dp(i + 1, 1, 1) + 1);
  if (!cell2) ret = max(ret, dp(i + 1, 1, 1) + 1);
  if (!cell1 && !cell2)
    ret = max({ret, dp(i + 1, 1, 0) + 1, dp(i + 1, 0, 1) + 1});
  return ret;
}
int main() {
  scanf("%s%s", &A[0], &A[1]);
  n = strlen(A[0]);
  for (int i = 1; i <= 2; i++)
    for (int j = 1; j <= n; j++) a[i][j] = A[i - 1][j - 1];
  printf("%d\n", dp(1, 0, 0));
}
