#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
int sum[200000 + 10];
int main() {
  string s1, s2;
  cin >> s1;
  cin >> s2;
  if (s1.length() < s2.length()) swap(s1, s2);
  sum[0] = s1[0] - '0';
  for (int i = 1, _n = s1.length(); i < _n; i++)
    sum[i] = sum[i - 1] + s1[i] - '0';
  int diff = s1.length() - s2.length();
  long long res = 0LL;
  for (int i = 0, _n = s2.length(); i < _n; i++) {
    int tr = sum[i + diff];
    if (i != 0) tr -= sum[i - 1];
    if (s2[i] == '0')
      res += tr;
    else
      res += diff + 1 - tr;
  }
  printf("%lld\n", res);
  return 0;
}
