#include <bits/stdc++.h>
using namespace std;
char MG[200005];
char HG[200005];
int WOC[200005][2];
int main() {
  int L1, L2, i, j, L;
  long long sum;
  gets(MG);
  gets(HG);
  L1 = strlen(MG);
  L2 = strlen(HG);
  if (HG[0] == '0') {
    WOC[0][0] = 1;
    WOC[0][1] = 0;
  } else {
    WOC[0][0] = 0;
    WOC[0][1] = 1;
  }
  for (i = 1; i <= L2 - 1; i++) {
    if (HG[i] == '0') {
      WOC[i][0] = WOC[i - 1][0] + 1;
      WOC[i][1] = WOC[i - 1][1];
    } else {
      WOC[i][0] = WOC[i - 1][0];
      WOC[i][1] = WOC[i - 1][1] + 1;
    }
  }
  L = L2 - L1;
  sum = 0;
  for (j = 0; j <= L1 - 1; j++) {
    if (j == 0) {
      if (MG[j] == '0')
        sum = sum + WOC[L][1];
      else
        sum = sum + WOC[L][0];
    } else {
      if (MG[j] == '0')
        sum = sum + WOC[j + L][1] - WOC[j - 1][1];
      else
        sum = sum + WOC[j + L][0] - WOC[j - 1][0];
    }
  }
  printf("%I64d\n", sum);
}
