#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)5e5 + 10;
const int inf = (int)1e9 + 100000;
const double eps = 1e-9;
const string sdebug = string(5, '-') + "DEBUG START" + string(5, '-');
const string fdebug = string(5, '-') + "DEBUG FINISH" + string(5, '-');
int n, m;
long long a[MAXN], b[MAXN];
long long p[2][MAXN];
int main() {
  clock_t start = clock();
  ios_base::sync_with_stdio(false);
  string s;
  cin >> s;
  n = s.length();
  for (int i = 0; i < s.length(); ++i) a[i] = (s[i] - '0');
  cin >> s;
  m = s.length();
  for (int i = 0; i < s.length(); ++i) b[i] = (s[i] - '0');
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < m; ++j)
      p[i][j] = (j == 0 ? 0 : p[i][j - 1]) + (b[j] == i ? 1 : 0);
  long long ans = 0;
  for (int i = 0; i < n; ++i) ans += (p[!a[i]][m - n + i] - p[!a[i]][i - 1]);
  cout << ans << endl;
  return 0;
}
