#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int am[200100];
  for (int i = 0; i < (int)b.size(); i++) am[i] = 0;
  for (int i = 0; i < (int)b.size(); i++)
    if (b[i] == '1')
      am[i] = 1;
    else
      am[i] = 0;
  long long answer = 0;
  for (int i = 1; i <= (int)b.size() - 1; i++) am[i] = am[i - 1] + am[i];
  for (int i = 0; i < (int)a.size(); i++) {
    int beg = i;
    int en = b.size() - (a.size() - i);
    if (a[i] == '0') {
      answer += am[en];
      if (beg > 0) answer -= am[beg - 1];
    } else {
      answer -= am[en];
      if (beg > 0) answer += am[beg - 1];
      answer += en - beg + 1;
    }
  }
  cout << answer;
  return 0;
}
