#include <bits/stdc++.h>
using namespace std;
string a, b;
int cc[2][200005];
int main() {
  cin >> a >> b;
  int lena = a.length();
  int lenb = b.length();
  for (int i = lenb - 1; i >= 0; i--) {
    if (i < lenb - 1) {
      cc[0][i] = cc[0][i + 1];
      cc[1][i] = cc[1][i + 1];
    }
    if (b[i] == '0')
      cc[0][i]++;
    else
      cc[1][i]++;
  }
  long long ans = 0;
  for (int i = 0; i < lena; i++) {
    int ks = (a[i] - '0' + 1) % 2;
    ans += cc[ks][i] - cc[ks][lenb - lena + 1 + i];
  }
  printf("%I64d\n", ans);
  return 0;
}
