1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// pun: Liczenie punktów | 2022-12-12 | Solution by Mikołaj Zabłocki (Dominik Korsa)
// https://sio2.mimuw.edu.pl/c/pa-2022-1/p/pun/

#include <iostream>
#include <vector>

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  int n;
  cin >> n;
  long long result = 0;
  for (int g = 0; g < 10; ++g) {
    bool valid = true;
    for (int i = 0; i < n/10; ++i) {
      char c;
      cin >> c;
      valid = valid && c == 'T';
    }
    result += valid;
  }
  cout << result << endl;
  return 0;
}