#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  if (x < 0) return -x;
  return x;
}
template <class T>
T sqr(T a) {
  return a * a;
}
const double pi = acos(-1.0);
const double eps = 1e-8;
int i, n, cnt;
char s1[110], s2[110];
void fun1() {
  if (s1[i + 1] == '0') {
    s1[i + 1] = 'X';
    cnt++;
  } else if (s2[i + 1] == '0') {
    s2[i + 1] = 'X';
    cnt++;
  }
}
void fun2() {
  if (s1[i + 1] == '0' && s2[i + 1] == '0') {
    s1[i + 1] = 'X';
    s2[i + 1] = 'X';
    cnt++;
  }
}
int main() {
  while (2 == scanf("%s%s", &s1, s2)) {
    cnt = 0;
    n = strlen(s1);
    for (i = 0; i < n - 1; i++) {
      if (s1[i] == '0' && s2[i] == '0') fun1();
      if (s1[i] == '0' || s2[i] == '0') fun2();
    }
    printf("%d\n", cnt);
  }
  return 0;
}
