#include <iostream>
#include <cstring>
using namespace std;
bool f (char x)
{
return ((x<='9') || (x>='a' && x<='z') || (x>='A' && x<='Z')); //Проверяем является ли символ частью числа или переменной.
}
int main()
{
short int k = 0;
char s[250];
while (cin>>s[k])
{
k++;
}
char * c = strpbrk (s+1, "+-*");
short int n = 0;
while (c!=NULL)
{
if (f(s[c-1 - s]) && f(s[c+1-s])&&(c-s!=k-1))
{
n++;
}
s[c-s] = ' ';
c = strpbrk (s+1, "+-*");
}
cout<<n;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKIApib29sIGYgKGNoYXIgeCkKewoJcmV0dXJuICgoeDw9JzknKSB8fCAoeD49J2EnICYmIHg8PSd6JykgfHwgKHg+PSdBJyAmJiB4PD0nWicpKTsgLy/Qn9GA0L7QstC10YDRj9C10Lwg0Y/QstC70Y/QtdGC0YHRjyDQu9C4INGB0LjQvNCy0L7QuyDRh9Cw0YHRgtGM0Y4g0YfQuNGB0LvQsCDQuNC70Lgg0L/QtdGA0LXQvNC10L3QvdC+0LkuCn0KIAppbnQgbWFpbigpCnsKCXNob3J0IGludCBrID0gMDsKCWNoYXIgc1syNTBdOwoJd2hpbGUgKGNpbj4+c1trXSkKCXsKCQlrKys7Cgl9CgkKCWNoYXIgKiBjID0gc3RycGJyayAocysxLCAiKy0qIik7CglzaG9ydCBpbnQgbiA9IDA7Cgl3aGlsZSAoYyE9TlVMTCkKCXsKCQlpZiAoZihzW2MtMSAtIHNdKSAmJiBmKHNbYysxLXNdKSYmKGMtcyE9ay0xKSkKCQl7CgkJCW4rKzsKCQl9CgkJc1tjLXNdID0gJyAnOwoJCWMgPSBzdHJwYnJrIChzKzEsICIrLSoiKTsKCX0KCWNvdXQ8PG47CglyZXR1cm4gMDsKfQ==