#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1;
  cin >> s2;
  int l1 = s1.length(), l2 = s2.length();
  int d = l2 - l1 + 1, i = 0, n = 0;
  long long c = 0;
  while (i < d) {
    if (s2[i] == '1') n++;
    i++;
  }
  for (i = 0; i < l1; i++) {
    if (s1[i] == '0')
      c += n;
    else
      c += (d - n);
    n += (s2[d + i] - s2[i]);
  }
  cout << c;
}
