#include <bits/stdc++.h>
using namespace std;
char a[200500], b[208004];
long long sum[208004], sum1[208004];
int main() {
  scanf("%s", a);
  scanf("%s", b);
  int l1 = strlen(a);
  int l2 = strlen(b);
  if (b[0] == '0')
    sum[0]++;
  else
    sum1[0]++;
  for (int i = 1; i < l2; i++) {
    if (b[i] == '0')
      sum[i]++;
    else
      sum1[i]++;
    sum[i] += sum[i - 1];
    sum1[i] += sum1[i - 1];
  }
  long long ans = 0;
  if (a[0] == '0')
    ans += sum1[l2 - l1];
  else
    ans += sum[l2 - l1];
  for (int i = 1; i < l1; i++) {
    if (a[i] == '0')
      ans += sum1[l2 - l1 + i] - sum1[i - 1];
    else
      ans += sum[l2 - l1 + i] - sum[i - 1];
  }
  printf("%lld\n", ans);
}
