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