#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int main()
{
Faster;
string s; cin >> s;
for(auto &x : s)
{
if(x != '*') x = ' ';
}
stringstream ss(s);
int ans = 0;
string x;
while(ss >> x)
{
ans += x.size()* (x.size() + 1) / 2;
}
cout << ans;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKaW50IG1haW4oKQp7CiAgICBGYXN0ZXI7CiAgICBzdHJpbmcgczsgY2luID4+IHM7CiAgICBmb3IoYXV0byAmeCA6IHMpCiAgICB7CiAgICAgICAgaWYoeCAhPSAnKicpIHggPSAnICc7CiAgICB9CiAgICBzdHJpbmdzdHJlYW0gc3Mocyk7CiAgICBpbnQgYW5zID0gMDsKICAgIHN0cmluZyB4OwogICAgd2hpbGUoc3MgPj4geCkKICAgIHsKICAgICAgICBhbnMgKz0geC5zaXplKCkqICh4LnNpemUoKSArIDEpIC8gMjsKICAgIH0KICAgIGNvdXQgPDwgYW5zOwogICAgcmV0dXJuIDA7Cn0K