n = int(input()) a = input() dob = 0 wyn = 0 for t in range(1,n+1): if a[t-1] == 'T': dob += 1 if t % (n/10) == 0: if dob == n / 10: wyn += 1 dob = 0 else: dob = 0 print(wyn)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | n = int(input()) a = input() dob = 0 wyn = 0 for t in range(1,n+1): if a[t-1] == 'T': dob += 1 if t % (n/10) == 0: if dob == n / 10: wyn += 1 dob = 0 else: dob = 0 print(wyn) |