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