#include <bits/stdc++.h>
using namespace std;
int sum[200200];
int main() {
  string s1, s2;
  while (cin >> s1 >> s2) {
    sum[0] = 0;
    long long ans = 0;
    ;
    for (int i = 0; i < s2.length(); ++i) sum[i + 1] = sum[i] + s2[i] - '0';
    int len = s2.length() - s1.length();
    for (int i = 0; i < s1.length(); ++i)
      if (s1[i] == '0')
        ans += sum[i + len + 1] - sum[i];
      else
        ans += 1 + len + sum[i] - sum[i + len + 1];
    cout << ans << endl;
  }
}
