import string s = input('Enter string: ') count = 0 for i in s: if i in string.punctuation: count += 1 print(count)