from collections import deque N=int(input()) S=input() arr=[] i=0 while i=0: if arr[i]=="CPC" or arr[i]=="F": if i-2>=0: if arr[i-1]=="T" and arr[i-2]=="CPC": i-=3 ans+=1 continue i+=1 print(ans)