#include <bits/stdc++.h>
using namespace std;
string s1, s2;
long long int pr[200005][2], al = 0, bl = 0, res = 0;
long long int abas(long long int x) {
  if (x == 0) return 0;
  return 1;
}
int main() {
  cin >> s1 >> s2;
  al = s1.length();
  bl = s2.length();
  for (int i = 0; i < bl; i++) {
    pr[i + 1][0] = pr[i][0];
    pr[i + 1][1] = pr[i][1];
    if (s2[i] == '1')
      pr[i + 1][1]++;
    else
      pr[i + 1][0]++;
  }
  for (int i = 0; i < al; i++) {
    long long int f = s1[i] - '0';
    for (int c = 0; c <= 1; c++)
      res += ((abas(f - c)) * (pr[bl - al + i + 1][c] - pr[i][c]));
  }
  cout << res << endl;
  return 0;
}
