import java.util.Scanner;
import java.util.regex.*;
public class Main
{
public static void main
(String[] args
) {
int sentenceCount = 0;
Pattern pattern = Pattern.compile("[.!?]+");
Matcher matcher;
Scanner scanner
= new Scanner
(System.
in);
string = scanner.nextLine();
matcher = pattern.matcher(string);
while (matcher.find()) sentenceCount++;
System.
out.
println(sentenceCount
); }
}
aW1wb3J0IGphdmEudXRpbC5TY2FubmVyOwppbXBvcnQgamF2YS51dGlsLnJlZ2V4Lio7CgpwdWJsaWMgY2xhc3MgTWFpbgp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykKCXsKCQlTdHJpbmcgc3RyaW5nOwoJCWludCBzZW50ZW5jZUNvdW50ID0gMDsKCQlQYXR0ZXJuIHBhdHRlcm4gPSBQYXR0ZXJuLmNvbXBpbGUoIlsuIT9dKyIpOwoJCU1hdGNoZXIgbWF0Y2hlcjsKCQlTY2FubmVyIHNjYW5uZXIgPSBuZXcgU2Nhbm5lcihTeXN0ZW0uaW4pOwoJCQoJCXN0cmluZyA9IHNjYW5uZXIubmV4dExpbmUoKTsKCQltYXRjaGVyID0gcGF0dGVybi5tYXRjaGVyKHN0cmluZyk7CgoJCXdoaWxlIChtYXRjaGVyLmZpbmQoKSkgc2VudGVuY2VDb3VudCsrOwoJCQoJCVN5c3RlbS5vdXQucHJpbnRsbihzZW50ZW5jZUNvdW50KTsKCX0KfQ==