#include <bits/stdc++.h>
using namespace std;
char pat[4][2][2] = {{{'X', '0'}, {'X', 'X'}},
                     {{'X', 'X'}, {'X', '0'}},
                     {{'0', 'X'}, {'X', 'X'}},
                     {{'X', 'X'}, {'0', 'X'}}};
char Board1[2][200];
char Board2[2][200];
int main() {
  int n = 0;
  for (int(i) = 0; (i) < (int)(2); (i)++) {
    string s;
    cin >> s;
    n = (int)s.size();
    for (int(j) = 0; (j) < (int)(s.size()); (j)++) Board1[i][j] = s[j];
    for (int(j) = 0; (j) < (int)(s.size()); (j)++) Board2[i][j] = s[j];
  }
  int ans1 = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int(j) = 0; (j) < (int)(4); (j)++) {
      bool flag = true;
      for (int(x) = 0; (x) < (int)(2); (x)++)
        for (int(y) = 0; (y) < (int)(2); (y)++) {
          if (Board1[x][i + y] == 'X' && pat[j][x][y] == 'X') {
            flag = false;
          }
        }
      if (flag) {
        ans1++;
        for (int(x) = 0; (x) < (int)(2); (x)++)
          for (int(y) = 0; (y) < (int)(2); (y)++) {
            if (pat[j][x][y] == 'X') {
              Board1[x][i + y] = 'X';
            }
          }
      }
    }
  }
  int ans2 = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int(j) = 0; (j) < (int)(4); (j)++) {
      bool flag = true;
      for (int(x) = 0; (x) < (int)(2); (x)++)
        for (int(y) = 0; (y) < (int)(2); (y)++) {
          if (Board2[x][i + y] == 'X' && pat[j][x][y] == 'X') {
            flag = false;
          }
        }
      if (flag) {
        ans2++;
        for (int(x) = 0; (x) < (int)(2); (x)++)
          for (int(y) = 0; (y) < (int)(2); (y)++) {
            if (pat[j][x][y] == 'X') {
              Board2[x][i + y] = 'X';
            }
          }
      }
    }
  }
  cout << max(ans1, ans2) << endl;
  return 0;
}
