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