#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 7;
const int MAXN = 2e5 + 10;
const int INF = 0x3f3f3f3f;
int n, m;
long long pre_sum[MAXN];
char s1[MAXN], s2[MAXN];
int main() {
  scanf("%s", s1);
  scanf("%s", s2);
  pre_sum[0] = s2[0] - '0';
  for (int i = 1; s2[i] != '\0'; ++i) {
    pre_sum[i] += pre_sum[i - 1] + s2[i] - '0';
  }
  long long ans = 0;
  int len1 = strlen(s1);
  int len2 = strlen(s2);
  for (int i = 0; s1[i] != '\0'; ++i) {
    if (i == 0) {
      if (s1[i] == '1')
        ans += abs(len2 - len1 + 1 - (pre_sum[len2 - len1]));
      else
        ans += abs(0 - pre_sum[len2 - len1]);
    } else {
      if (s1[i] == '1')
        ans +=
            abs(len2 - len1 + 1 - (pre_sum[len2 - len1 + i] - pre_sum[i - 1]));
      else
        ans += abs(0 - (pre_sum[len2 - len1 + i] - pre_sum[i - 1]));
    }
  }
  printf("%lld\n", ans);
  return 0;
}
