#include <bits/stdc++.h>
using namespace std;
long long arr[1001], ans;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') arr[i]++;
  }
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') arr[i]++;
  }
  for (int i = 0; i < s.size(); i++) {
    if (arr[i] == 2) {
      if (arr[i + 1] > 0) {
        arr[i + 1]--;
        arr[i] = 0;
        ans++;
      }
    } else if (arr[i] == 1) {
      if (arr[i + 1] == 2) {
        arr[i + 1] = 0;
        arr[i] = 0;
        ans++;
      }
    }
  }
  printf("%I64d", ans);
}
