G,C,P = map(int,raw_input().split(' '))#GCP S = raw_input() count = 0 g,c,p = 0,0,0 for s in S: if s == 'G': g += 1 if s == 'C': c += 1 if s == 'P': p += 1 count = (g + c + p) * 3 print count