#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[200005], b[200005];
  int b01[200005][2] = {0}, lena, lenb, tmp;
  long long sum = 0;
  cin >> a;
  cin >> b;
  lena = strlen(a);
  lenb = strlen(b);
  for (int i = 0; i < lenb; ++i) {
    tmp = b[i] - '0';
    b01[i][tmp] = b01[i - 1][tmp] + 1;
    b01[i][!tmp] = b01[i - 1][!tmp];
  }
  for (int i = 0; i < lena; ++i) {
    tmp = a[i] - '0';
    sum += b01[lenb - lena + i][!tmp] - b01[i - 1][!tmp];
  }
  cout << sum;
}
