#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 9;
const int inf = 2e9 + 9;
char a[maxn], b[maxn];
int main() {
  while (~scanf("%s%s", a, b)) {
    int alen = strlen(a), blen = strlen(b);
    long long cnt = 0;
    for (int i = 0; i + alen <= blen; i++) {
      if (a[0] != b[i]) cnt++;
    }
    long long last = cnt;
    int loca = blen - alen + 1;
    for (int i = 1; i < alen; i++) {
      if (a[i] == a[i - 1]) {
        if (a[i - 1] != b[i - 1]) last--;
        if (a[i] != b[loca++]) last++;
        cnt += last;
      } else {
        if (a[i - 1] != b[i - 1]) last--;
        last = blen - alen - last;
        if (a[i] != b[loca++]) last++;
        cnt += last;
      }
    }
    printf("%I64d\n", cnt);
  }
  return 0;
}
