#include <bits/stdc++.h>
using namespace std;
long long dp[300100];
int main() {
  string a, b;
  cin >> a >> b;
  int n = a.length();
  int m = b.length();
  int num = m - n + 1;
  long long ans = 0;
  int sum = 0;
  for (long long i = 0; i < num; i++) sum += (b[i] - '0');
  dp[0] = sum;
  int j = 1;
  int l = num;
  for (long long i = num; i < m; i++) {
    dp[j] = dp[j - 1] + (b[i] - '0') - (b[i - l] - '0');
    j++;
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] == '0') {
      ans = (ans + dp[i]);
    } else
      ans = ans + (l - dp[i]);
  }
  cout << ans;
  return 0;
}
