#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
const int MAXS = 200010;
string A, B;
int F[MAXS][2];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cin >> A >> B;
for (int i = 1; i <= B.size(); i++) {
for (int j = 0; j < 2; j++) {
F[i][j] = F[i - 1][j];
}
++F[i][B[i - 1] - '0'];
}
ll res = 0;
for (int i = 0, c; i < A.size(); i++) {
c = A[i]-'0';
for (int j = 0; j < 2; j++) {
res += abs(c - j) * (F[B.size() - A.size() + i + 1][j] - F[i][j]);
}
}
cout << res << '\n';
return 0;
}
I2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHN0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdHlwZWRlZiBsb25nIGxvbmcgbGw7CmNvbnN0IGludCBNQVhTID0gMjAwMDEwOwoKc3RyaW5nIEEsIEI7CmludCBGW01BWFNdWzJdOwoKaW50IG1haW4oKSB7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwogICAgY2luLnRpZShOVUxMKTsKICAgIGNpbiA+PiBBID4+IEI7CiAgICBmb3IgKGludCBpID0gMTsgaSA8PSBCLnNpemUoKTsgaSsrKSB7CiAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCAyOyBqKyspIHsKICAgICAgICAgICAgRltpXVtqXSA9IEZbaSAtIDFdW2pdOwogICAgICAgIH0KICAgICAgICArK0ZbaV1bQltpIC0gMV0gLSAnMCddOwogICAgfQogICAgbGwgcmVzID0gMDsKICAgIGZvciAoaW50IGkgPSAwLCBjOyBpIDwgQS5zaXplKCk7IGkrKykgewogICAgICAgIGMgPSBBW2ldLScwJzsKICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDI7IGorKykgewogICAgICAgICAgICByZXMgKz0gYWJzKGMgLSBqKSAqIChGW0Iuc2l6ZSgpIC0gQS5zaXplKCkgKyBpICsgMV1bal0gLSBGW2ldW2pdKTsKICAgICAgICB9CiAgICB9CiAgICBjb3V0IDw8IHJlcyA8PCAnXG4nOwogICAgcmV0dXJuIDA7Cn0K