#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int dp[105][4];
char s[2][105];
int main() {
  scanf("%s%s", s[0], s[1]);
  int l = strlen(s[0]);
  for (int i = 0; i < l; i++) {
    for (int j = 0; j < 4; j++) dp[i][j] = -INF;
  }
  int mask = (s[0][0] == 'X') * 2 + (s[1][0] == 'X');
  dp[0][mask] = 0;
  for (int i = 1; i < l; i++) {
    mask = (s[0][i] == 'X') * 2 + (s[1][i] == 'X');
    for (int j = 0; j < 4; j++) dp[i][mask] = max(dp[i][mask], dp[i - 1][j]);
    if (mask == 0) {
      dp[i][1] = max(dp[i][1], dp[i - 1][0] + 1);
      dp[i][2] = max(dp[i][2], dp[i - 1][0] + 1);
      dp[i][3] =
          max(dp[i][3], max({dp[i - 1][0], dp[i - 1][1], dp[i - 1][2]}) + 1);
    } else if (mask == 1) {
      dp[i][3] = max(dp[i][3], dp[i - 1][0] + 1);
    } else if (mask == 2) {
      dp[i][3] = max(dp[i][3], dp[i - 1][0] + 1);
    }
  }
  printf("%d\n", max({dp[l - 1][0], dp[l - 1][1], dp[l - 1][2], dp[l - 1][3]}));
}
