S = input().strip() S = S.replace('-', '') S = S.replace('min', '@') cnt = 0 for i in S: if i == '@': cnt += 1 print(str(cnt))