#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  long long int ans = 0, a = s1.length(), b = s2.length();
  int arr[b];
  for (int i = 0; i < b; i++) arr[i] = s2[i] - 48;
  for (int i = 1; i < b; i++) arr[i] += arr[i - 1];
  for (int i = 0; i < a; i++) {
    int endindex = b - a + i;
    int count;
    if (i == 0)
      count = arr[endindex];
    else
      count = arr[endindex] - arr[i - 1];
    if (s1[i] == '0')
      ans += count;
    else
      ans = ans + b - a + 1 - count;
  }
  cout << ans;
}
