#include <bits/stdc++.h>
using namespace std;
char a[200005], b[200005];
long long nb[200005];
int main() {
  scanf("%s", &a);
  scanf("%s", &b);
  long long la = strlen(a), lb = strlen(b), fk = 0, one = 0, ans = 0;
  for (long long i = 0; i <= lb - la; i++) {
    if (b[i] == '1') fk++;
  }
  nb[0] = fk;
  for (long long i = lb - la + 1; i < lb; i++) {
    nb[i + la - lb] = nb[i + la - lb - 1];
    if (b[i + la - lb - 1] == '1') nb[i + la - lb]--;
    if (b[i] == '1') nb[i + la - lb]++;
  }
  for (long long i = 0; i < la; i++) {
    if (a[i] == '1')
      ans += lb - la + 1 - nb[i];
    else
      ans += nb[i];
  }
  printf("%I64d\n", ans);
  return 0;
}
