#include <bits/stdc++.h>
char str[200027], str2[200027];
long long num[200027];
int main() {
  long long i, j, sum, tot, c;
  scanf(" %s %s", str, str2);
  for (i = 0, sum = 0; str2[i]; ++i) {
    if (str2[i] == '1') sum++;
    num[i] = sum;
  }
  c = strlen(str);
  for (j = 0, tot = 0; str[j]; ++j)
    if (str[j] == '0')
      tot += num[i - c + j] - num[j] + str2[j] - '0';
    else
      tot += i - c + 1 - num[i - c + j] + num[j] - str2[j] + '0';
  printf("%lld\n", tot);
  return 0;
}
