#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int len = s1.length();
  int total = 0;
  int **m = new int *[2];
  for (int i = 0; i < 2; i++) m[i] = new int[len];
  for (int i = 0; i < len; i++) {
    if (s1[i] == '0')
      m[0][i] = 0;
    else
      m[0][i] = 1;
  }
  for (int i = 0; i < len; i++) {
    if (s2[i] == '0')
      m[1][i] = 0;
    else
      m[1][i] = 1;
  }
  for (int j = 0; j < len - 1; j++) {
    if (m[0][j] == 0 && m[0][j + 1] == 0) {
      if (m[1][j] == 0) {
        total++;
        m[0][j] = 1;
        m[0][j + 1] = 1;
        m[1][j] = 1;
      } else if (m[1][j + 1] == 0) {
        total++;
        m[0][j] = 1;
        m[0][j + 1] = 1;
        m[1][j + 1] = 1;
      }
    }
    if (m[1][j] == 0 && m[1][j + 1] == 0) {
      if (m[0][j] == 0) {
        total++;
        m[1][j] = 1;
        m[1][j + 1] = 1;
        m[0][j] = 1;
      } else if (m[0][j + 1] == 0) {
        total++;
        m[1][j] = 1;
        m[1][j + 1] = 1;
        m[0][j + 1] = 1;
      }
    }
  }
  cout << total << endl;
}
