import sequtils template `max=`*(x,y) = x = max(x,y) template `min=`*(x,y) = x = min(x,y) proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" ,discardable.} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': return result = 10 * result + k.ord - '0'.ord let n = scan() let S = stdin.readLine() var U = newSeq[int]() var ans = 0 for i in 0..= n : break if S[gi] == 'G' : ans += 1 echo ans