#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
long long int dp[200005] = {0};
int main() {
  string a, b;
  while (cin >> a >> b) {
    for (long long int i = 0; b[i]; ++i) {
      dp[i + 1] = dp[i] + (b[i] - '0');
    }
    long long int num = b.length() - a.length();
    long long int ans = 0;
    for (long long int i = 0; a[i]; ++i) {
      if (a[i] == '0')
        ans += dp[i + (num + 1)] - dp[i];
      else
        ans += (num + 1) - (dp[i + (num + 1)] - dp[i]);
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
