#include <bits/stdc++.h>
using namespace std;
char a[5][120];
int main() {
  scanf("%s%s", a[1] + 1, a[2] + 1);
  int n = strlen(a[1] + 1), ans = 0;
  for (int i = 1; i <= n; i++)
    if (a[1][i] == '0' && a[2][i] == '0') {
      for (int j = 1; j <= 2; j++)
        if (a[j][i - 1] == '0') {
          a[j][i - 1] = 'X';
          a[1][i] = a[2][i] = 'X';
          ans++;
          break;
        }
      if (a[1][i] == '0' && a[2][i] == '0') {
        for (int j = 1; j <= 2; j++)
          if (a[j][i + 1] == '0') {
            a[j][i + 1] = 'X';
            a[1][i] = a[2][i] = 'X';
            ans++;
            break;
          }
      }
    }
  printf("%d", ans);
  return 0;
}
