#include <bits/stdc++.h>
using namespace std;
const int maxm = 1e6 + 10;
char s1[maxm], s2[maxm];
long long dp1[maxm];
int main() {
  while (scanf("%s%s", s1, s2) != EOF) {
    memset(dp1, 0, sizeof(dp1));
    long long len1 = strlen(s1), len2 = strlen(s2);
    for (long long i = 1; i <= len2; i++) {
      dp1[i] = dp1[i - 1] + s2[i - 1] - '0';
    }
    long long sum = 0, num = 0;
    for (long long i = 0; i < len1; i++) num += s1[i] - '0';
    for (long long i = 0; i < len1; ++i) {
      if (s1[i] == '0')
        sum += (dp1[len2 - len1 + i + 1] - dp1[i]);
      else
        sum += (len2 - len1 + 1 - dp1[len2 - len1 + i + 1] + dp1[i]);
    }
    printf("%lld\n", sum);
  }
  return 0;
}
