#include <bits/stdc++.h>
using namespace std;
const int maxN = 3e5 + 1000;
int d[maxN];
int sum(int l, int r) {
  if (l == 0)
    return d[r];
  else
    return d[r] - d[l - 1];
}
int main(void) {
  int n;
  ios_base::sync_with_stdio(0);
  string s1, s2;
  cin >> s1 >> s2;
  int a = (int)s1.size();
  int b = (int)s2.size();
  long long ans = 0;
  for (int i = 0; i < a; i++) {
    if (i == 0) {
      d[i] = s1[i] == '1';
    } else {
      d[i] = d[i - 1] + (s1[i] == '1');
    }
  }
  for (int i = 0; i < b; i++) {
    long long l = max(0, a - (b - i));
    long long r = min(a - 1, i);
    long long s = sum(l, r);
    if (s2[i] == '1') {
      ans += r - l + 1 - s;
    } else {
      ans += s;
    }
  }
  cout << ans << endl;
}
