#include <bits/stdc++.h>
using namespace std;
string s1, s2;
char c1[250001], c2[250001];
long long pref[250001][2], n, m, i, l, r, ans;
long long Abs(long long a) { return (a < 0 ? -a : a); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s1;
  cin >> s2;
  n = s1.size();
  for (i = 1; i <= n; i++) c1[i] = s1[i - 1];
  m = s2.size();
  for (i = 1; i <= m; i++) c2[i] = s2[i - 1];
  for (i = 1; i <= n; i++) {
    pref[i][0] = pref[i - 1][0] + (c1[i] == '0');
    pref[i][1] = pref[i - 1][1] + (c1[i] == '1');
  }
  for (i = 1; i <= m; i++) {
    if (i + n - 1 > m)
      l = (i + n - 1) - m + 1;
    else
      l = 1;
    if (1 > i - n + 1)
      r = n - (1 - (i - n + 1));
    else
      r = n;
    ans += pref[r][49 - c2[i]] - pref[l - 1][49 - c2[i]];
  }
  cout << ans << '\n';
  return 0;
}
