#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  a = abs(a);
  b = abs(b);
  if (!b) return a;
  return __gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / __gcd(a, b)) * b;
}
template <class T>
inline T ncr(T n, T r) {
  return n * (n - 1) / r;
}
int f[200005][2];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string a, b;
  cin >> a >> b;
  for (int i = 1; i <= b.size(); i++) {
    for (int j = 0; j <= 1; j++) f[i][j] = f[i - 1][j];
    f[i][b[i - 1] - '0']++;
  }
  long long int ans = 0;
  for (int i = 0; i < a.size(); i++) {
    for (int j = 0; j <= 1; j++) {
      ans +=
          abs((a[i] - '0') - j) * (f[b.size() - a.size() + i + 1][j] - f[i][j]);
    }
  }
  cout << ans << "\n";
  return 0;
}
