#include <bits/stdc++.h>
using namespace std;
string a, b;
int func(int x, int y) {
  int cn = 0;
  if (a[x] == '0') cn++;
  if (a[y] == '0') cn++;
  if (b[x] == '0') cn++;
  if (b[y] == '0') cn++;
  if (cn == 3) {
    if (a[x] == '0') a[x] = 'X';
    if (a[y] == '0') a[y] = 'X';
    if (b[x] == '0') b[x] = 'X';
    if (b[y] == '0') b[y] = 'X';
    return 1;
  }
  if (cn == 4) {
    if (a[x] == '0') a[x] = 'X';
    if (b[x] == '0') b[x] = 'X';
    if (b[y] == '0') b[y] = 'X';
    return 1;
  } else
    return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> a >> b;
  int n = a.size(), ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (func(i, i + 1)) ans++;
  }
  cout << ans << endl;
  return 0;
}
