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
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#include <iostream>

using namespace std;

int main()
{
    int n,w=0;
    cin >>n;
    char t[100];
    for (int i=0;i<n;i++)
    {
        cin >> t[i];
    }
    n/=10;
    if (n==1)
    {
     for (int i=0;i<n*10;i++)
     {
         if(t[i]=='T')
         {
             w+=1;
         }
     }
    }
    if (n==2)
    {
     for (int i=0;i<n*10;i+=2)
     {
         if(t[i]=='T'&&t[i+1]=='T')
         {
             w+=1;
         }
     }
    }
    if (n==3)
    {
     for (int i=0;i<n*10;i+=3)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T')
         {
             w+=1;
         }
     }
    }
    if (n==4)
    {
     for (int i=0;i<n*10;i+=4)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T')
         {
             w+=1;
         }
     }
    }
    if (n==5)
    {
     for (int i=0;i<n*10;i+=5)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T')
         {
             w+=1;
         }
     }
    }
    if(n==6)
    {
     for (int i=0;i<n*10;i+=6)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T'&&t[i+5]=='T')
         {
             w+=1;
         }
     }
    }
    if(n==7)
    {
     for (int i=0;i<n*10;i+=7)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T'&&t[i+5]=='T'&&t[i+6]=='T')
         {
             w+=1;
         }
     }
    }
    if(n==8)
    {
     for (int i=0;i<n*10;i+=8)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T'&&t[i+5]=='T'&&t[i+6]=='T'&&t[i+7]=='T')
         {
             w+=1;
         }
     }
    }
    if(n==9)
    {
     for (int i=0;i<n*10;i+=9)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T'&&t[i+5]=='T'&&t[i+6]=='T'&&t[i+7]=='T'&&t[i+8]=='T')
         {
             w+=1;
         }
     }
    }
    if(n==10)
    {
     for (int i=0;i<n*10;i+=10)
     {
         if(t[i]=='T'&&t[i+1]=='T'&&t[i+2]=='T'&&t[i+3]=='T'&&t[i+4]=='T'&&t[i+5]=='T'&&t[i+6]=='T'&&t[i+7]=='T'&&t[i+8]=='T'&&t[i+9]=='T')
         {
             w+=1;
         }
     }
    }
    cout <<w;
    return 0;
}