#include <bits/stdc++.h>
using namespace std;
char s1[105], s2[105];
int main() {
  cin.tie(0);
  int ans = 0;
  cin >> s1 >> s2;
  int len = strlen(s1);
  for (register int i = 0; i < len; i++) {
    if (s1[i] == '0' && s2[i] == '0' && s1[i + 1] == '0')
      s1[i] = s1[i + 1] = s2[i] = 'x', ans++;
    else if (s1[i] == '0' && s2[i] == '0' && s2[i + 1] == '0')
      s1[i] = s2[i] = s2[i + 1] = 'x', ans++;
    else if (s1[i] == '0' && s1[i + 1] == '0' && s2[i + 1] == '0')
      s1[i] = s1[i + 1] = s2[i + 1] = 'x', ans++;
    else if (s2[i] == '0' && s1[i + 1] == '0' && s2[i + 1] == '0')
      s2[i] = s1[i + 1] = s2[i + 1] = 'x', ans++;
  }
  cout << ans << endl;
}
