#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
char c[maxn], c2[maxn];
int len, ans;
template <class T>
inline void read(T &x);
void init() {
  scanf(" %s %s", c, c2);
  len = strlen(c);
}
void work() {
  for (int i = 0; i < len; i++) {
    if (i - 1 >= 0 && c[i] == '0' && c[i - 1] == '0' && c2[i] == '0') {
      ans++;
      c[i] = 'X';
      c[i - 1] = 'X';
      c2[i] = 'X';
    } else if (i - 1 >= 0 && c2[i] == '0' && c2[i - 1] == '0' && c[i] == '0') {
      ans++;
      c2[i] = 'X';
      c2[i - 1] = 'X';
      c[i] = 'X';
    } else if (i + 1 < len && c[i] == '0' && c[i + 1] == '0' && c2[i] == '0') {
      ans++;
      c[i] = 'X';
      c[i + 1] = 'X';
      c2[i] = 'X';
    } else if (i + 1 < len && c2[i] == '0' && c2[i + 1] == '0' && c[i] == '0') {
      ans++;
      c2[i] = 'X';
      c2[i + 1] = 'X';
      c[i] = 'X';
    }
  }
}
void print() { printf("%d\n", ans); }
int main() {
  init();
  work();
  print();
  return 0;
}
template <class T>
inline void read(T &x) {
  x = 0;
  int s = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') s = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= s;
}
