#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
char s[N], t[N];
int c[2][N];
vector<pair<int, int> > sub;
int sz;
int n;
long long ans;
int main() {
  cin >> s;
  cin >> t;
  n = (int)strlen(s);
  sz = (int)strlen(t);
  for (int i = 0; i < sz; i++) {
    c[t[i] - '0'][i]++;
  }
  for (int i = 1; i < sz; i++) {
    c[0][i] += c[0][i - 1];
    c[1][i] += c[1][i - 1];
  }
  int idx = (sz - n);
  for (int i = 0; i < n; i++) {
    int e = idx + i;
    ans += c[1 - (s[i] - '0')][e];
    if (i) {
      ans -= c[1 - (s[i] - '0')][i - 1];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
