#include <bits/stdc++.h>
using namespace std;
long long temp = 0, r, l, w, k = 0, m1, e, p, q, ans = 0, k1 = 0, k2 = 0, d = 0,
          a = 0, b = 0, s = 0, x, y, min1 = 1000000010, max1 = 0, m, c = 0,
          t = 0, i, n, c1 = 0, tot = 0, t1, k4 = 0, c2 = 0, j = 0, k3 = 0;
char ch, ch1, ch2;
string s1, s2, s3;
signed main() {
  cin >> s1 >> s2;
  n = s1.length();
  if (n == 1) {
    cout << 0;
    return 0;
  }
  k = 0;
  vector<long long> v1(110, 0), v2(110, 0);
  for (long long i = 1; i < n; i++) {
    if (s1[i] == s1[i - 1] && s1[i] == '0' && s2[i - 1] == '0' && !v1[i - 1] &&
        !v1[i] && !v2[i - 1]) {
      v1[i] = 1, v1[i - 1] = 1, v2[i - 1] = 1;
      c++;
    } else if (s1[i] == s1[i - 1] && s1[i] == '0' && s2[i] == '0' &&
               !v1[i - 1] && !v1[i] && !v2[i]) {
      v1[i] = 1, v1[i - 1] = 1, v2[i] = 1;
      c++;
    } else if (s2[i] == s2[i - 1] && s2[i] == '0' && s1[i - 1] == '0' &&
               !v2[i - 1] && !v2[i] && !v1[i - 1]) {
      v2[i] = 1, v2[i - 1] = 1, v1[i - 1] = 1;
      c++;
    } else if (s2[i] == s2[i - 1] && s2[i] == '0' && s1[i] == '0' &&
               !v2[i - 1] && !v2[i] && !v1[i]) {
      v2[i] = 1, v2[i - 1] = 1, v1[i] = 1;
      c++;
    }
  }
  cout << c;
}
