#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
char a[200005];
char b[200005];
int main() {
  cin >> a >> b;
  int n = strlen(a);
  int m = strlen(b);
  int diff = m - n + 1;
  int sum0 = 0;
  int sum1 = 0;
  for (int i = 0; i < diff; i++) {
    int x = b[i] - '0';
    if (x)
      sum0++;
    else
      sum1++;
  }
  long long int sum = (a[0] == '1') ? sum1 : sum0;
  for (int i = diff; i < m; i++) {
    int x = b[i] - '0';
    int y = b[i - diff] - '0';
    if (x)
      sum0++;
    else
      sum1++;
    if (y)
      sum0--;
    else
      sum1--;
    sum += (a[i - diff + 1] == '1') ? sum1 : sum0;
  }
  printf("%lld\n", sum);
  return 0;
}
