#include <bits/stdc++.h>
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T distsqr(T x, T y, T a, T b) {
  return sqr((x - a)) + sqr((y - b));
}
double cosine_angle(double a, double b, double c) {
  return (double)(sqr(a) + sqr(b) - sqr(c)) / ((double)2.0 * a * b);
}
template <class T>
T Maximum(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T Minimum(T a, T b) {
  return a < b ? a : b;
}
template <class T>
T GCD(T a, T b) {
  if (!b) return a;
  return GCD(b, a % b);
}
template <class T>
void SWAP(T &a, T &b) {
  T temp = a;
  a = b;
  b = temp;
  return;
}
template <class T>
T sign(T a) {
  return a < 0 ? -1 : 1;
}
template <class T>
T BigMod(T a, T n, T mod) {
  if (!n) return (T)1 % mod;
  long long int power = BigMod(a, n >> 1, mod);
  power %= mod;
  power *= power;
  power %= mod;
  if (n & 1) power *= a % mod, power %= mod;
  return power;
}
template <class T>
T ExtendedEuclid(T a, T b, T c) {
  if (!a) return 0;
  return (b * ExtendedEuclid(b % a, a, -c) + c) / a;
}
template <class T>
T ModInverse(T a, T m) {
  return ((ExtendedEuclid(a, m, (T)GCD(a, m))) % (m) + (m)) % (m);
}
char str[2][200010];
int ones[200010], zeros[200010];
int main() {
  int i, u, v, l0, l1;
  long long int c;
  scanf("%s %s", str[0], str[1]);
  for (l0 = 0; str[0][l0]; l0++)
    ;
  for (i = 0; str[1][i]; i++) {
    ones[i + 1] = ones[i] + (int)(str[1][i] == '1');
    zeros[i + 1] = zeros[i] + (int)(str[1][i] == '0');
  }
  l1 = i;
  for (i = c = 0; i < l0; i++) {
    if (str[0][i] == '0') {
      u = i;
      v = l0 - i;
      v = l1 - v;
      if (u <= v) c += ones[v + 1] - ones[u];
    } else {
      u = i;
      v = l0 - i;
      v = l1 - v;
      if (u <= v) c += zeros[v + 1] - zeros[u];
    }
  }
  printf("%lld\n", c);
  return 0;
}
