#include <bits/stdc++.h>
using namespace std;
string A, B;
int N, M;
int pre[2][200005];
int main() {
  cin >> A >> B;
  N = A.size(), M = B.size();
  for (int i = 1; i <= M; i++) {
    pre[0][i] = pre[0][i - 1];
    pre[1][i] = pre[1][i - 1];
    if (B[i - 1] == '1')
      pre[1][i]++;
    else
      pre[0][i]++;
  }
  long long ans = 0;
  for (int i = 0; i < N; i++)
    ans += pre[(A[i] - '0') ^ 1][M - N + i + 1] - pre[(A[i] - '0') ^ 1][i];
  cout << ans << "\n";
  return 0;
}
