#include <bits/stdc++.h>
using namespace std;
string s, t;
long long int answer, d[200001], l, r;
int main() {
  int minx = 10000, maxx = 0;
  cin >> s >> t;
  for (int i = 0; i < int(s.size()); i++) {
    if (i) {
      d[i] = d[i - 1];
    }
    if (s[i] == '1') {
      d[i]++;
    }
  }
  for (int i = 0; i < int(t.size()); i++) {
    l = max(0, int(s.size()) - int(t.size()) + i);
    r = min(int(s.size()) - 1, i);
    if (t[i] == '0') {
      if (l == 0) {
        answer += d[r];
      } else {
        answer += (d[r] - d[l - 1]);
      }
    } else {
      if (l == 0) {
        answer += (r - l + 1) - d[r];
      } else {
        answer += (r - l + 1) - (d[r] - d[l - 1]);
      }
    }
  }
  cout << answer << endl;
}
