#include <bits/stdc++.h>
using namespace std;
char s1[200010];
char s2[200010];
int num[2][200010];
int main() {
  scanf("%s %s", s1 + 1, s2 + 1);
  int len1 = strlen(s1 + 1);
  int len2 = strlen(s2 + 1);
  for (int i = 1; i <= len2; i++) {
    num[0][i] = num[0][i - 1] + (s2[i] == '0');
    num[1][i] = num[1][i - 1] + (s2[i] == '1');
  }
  long long res = 0;
  for (int i = 1; i <= len1; i++) {
    int l = i;
    int r = len2 - (len1 - i);
    if (s1[i] == '0')
      res += num[1][r] - num[1][l - 1];
    else
      res += num[0][r] - num[0][l - 1];
  }
  cout << res << endl;
  return 0;
}
