#include <bits/stdc++.h>
using namespace std;
const int maxN = 107;
const int INF = 1e5;
char s[2][maxN];
int dp[maxN][5];
int main() {
  scanf("%s", s[0] + 1);
  scanf("%s", s[1] + 1);
  int n = strlen(s[0] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 4; j++) dp[i][j] = -INF;
  int sta = 0;
  if (s[0][1] == 'X') sta += 1;
  if (s[1][1] == 'X') sta += 2;
  dp[1][sta] = 0;
  for (int i = 2; i <= n; i++) {
    sta = 0;
    if (s[0][i] == 'X') sta += 1;
    if (s[1][i] == 'X') sta += 2;
    for (int j = 0; j < 4; j++)
      if ((sta & j) == sta) {
        for (int k = 0; k < 4; k++) dp[i][j] = max(dp[i][j], dp[i - 1][k]);
        if ((sta & 1) == 0 && (j & 1) == 1)
          dp[i][j] = max(dp[i][j], dp[i - 1][0] + 1);
        if ((sta & 3) == 0 && (j & 3) == 3) {
          dp[i][j] = max(dp[i][j], dp[i - 1][0] + 1);
          dp[i][j] = max(dp[i][j], dp[i - 1][2] + 1);
          dp[i][j] = max(dp[i][j], dp[i - 1][1] + 1);
        }
        if ((sta & 2) == 0 && (j & 2) == 2)
          dp[i][j] = max(dp[i][j], dp[i - 1][0] + 1);
      }
  }
  int ans = 0;
  for (int i = 0; i < 4; i++) ans = max(ans, dp[n][i]);
  printf("%d\n", ans);
  return 0;
}
