#include <iostream>
#include <cstring>
using namespace std;

int main() {
	int k=0;
	char s[251];
	cin.getline (s, 251);
	for (int i=0; i<strlen(s); i++)
	if((s[i]==33 or s[i]==46 or s[i]==63) and ((s[i-1]>=65 && s[i-1]<=90) or (s[i-1]>=97 && s[i-1]<=122) or(s[i-1]>=48 && s[i-1]<=57))) k++;
	cout << k;
	return 0;
}