#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0;
  long long t = 0;
  string s, s2;
  cin >> s >> s2;
  int n = s2.size() - s.size();
  for (int i = 0; i < n; i++) {
    c += s2[i] - '0';
  }
  for (int i = 0; i < s.size(); i++) {
    c += s2[i + n] - '0';
    if (i) c -= s2[i - 1] - '0';
    if (s[i] == '0')
      t += c;
    else
      t += n - c + 1;
  }
  cout << t;
  return 0;
}
