#Cotter  Enloe HS  Senior Div Python

 

#Diamond=0,Club=1,Spade=2,Heart=3

#Nine=0,Ten=1,Jack=2,Queen=3,King=4,Ace=5

#hand[SUIT][CARD]

suit = {"D":0,"C":1,"S":2,"H":3}

card = {"N":0,"T":1,"J":2,"Q":3,"K":4,"A":5}

TESTING = {1:"D,AAKQQJN,ATQ,TQJ,TKQ",

           2:"C,N,AKQJN,AATQN,AAKJN",

           3:"C,KJ,ATKQJN,KKJN,TKQJ",

           4:"S,AJJK,AJJK,AJJK,AJJK",

           5:"H,JJAQ,KQAN,QQAN,KQAN"}

for y in range(5):

    hand = [[0,0,0,0,0,0],

            [0,0,0,0,0,0],

            [0,0,0,0,0,0],

            [0,0,0,0,0,0],]

    #input = raw_input("[Trump],[Diamonds],[Clubs],[Spades],[Hearts]")

    print TESTING.get(y+1)

    input = TESTING.get(y+1)

    trump = 0

    score = 0

    case = 1

    for letter in input:

        if letter==",":

            case +=1

        elif case == 1:

            trump = suit.get(letter)

        elif case == 2:

            hand[0][card.get(letter)] += 1

        elif case == 3:

            hand[1][card.get(letter)] += 1

        elif case == 4:

            hand[2][card.get(letter)] += 1

        elif case == 5:

            hand[3][card.get(letter)] += 1

    bookMarriage = True

    #Single Book Trump

    if hand[trump][1]>=1 and hand[trump][2]>=1 and hand[trump][3]>=1 and hand[trump][4]>=1 and hand[trump][5]>=1:

        score += 15

        if hand[trump][3] < 2 or hand[trump][4] < 2:

            bookMarriage = False

    #Trump Marriage

    if hand[trump][3] >=1 and hand[trump][4] >= 1 and bookMarriage:

        score += 4

    if hand[trump][3] >=2 and hand[trump][4] >= 2 and bookMarriage:

        score += 4

    #Non-Trump Marriage

    for x in range(4):

        if hand[x][3]>=1 and hand[x][4]>=1 and not x == trump:

            score += 2

        if hand[x][3]>=2 and hand[x][4]>=2 and not x == trump:

            score += 2

    #Double Book

    if hand[trump][1]>=2 and hand[trump][2]>=2 and hand[trump][3]>=2 and hand[trump][4]>=2 and hand[trump][5]>=2:

        score += 150

        score += 15

        score += 4

    #2JofD and 2QofS 

    if hand[0][2]>=2 and hand[2][3]>=2:

        score += 30

        score += 4

    #4 Aces

    if hand[0][5]>=1 and hand[1][5]>=1 and hand[2][5]>=1 and hand[3][5]>=1:

        score += 10

    #4 Kings

    if hand[0][4]>=1 and hand[1][4]>=1 and hand[2][4]>=1 and hand[3][4]>=1:

        score += 8

    #8 Aces

    if hand[0][5]>=2 and hand[1][5]>=2 and hand[2][5]>=2 and hand[3][5]>=2:

        score += 100

        score += 10

    #8 Kings

    if hand[0][4]>=2 and hand[1][4]>=2 and hand[2][4]>=2 and hand[3][4]>=2:

        score += 80

        score += 8

    #1JofD and 1QofS

    if hand[0][2]>=1 and hand[2][3]>=1:

        score += 4

    #4 Queens

    if hand[0][3]>=1 and hand[1][3]>=1 and hand[2][3]>=1 and hand[3][3]>=1:

        score += 6

    #4 Jacks

    if hand[0][2]>=1 and hand[1][2]>=1 and hand[2][2]>=1 and hand[3][2]>=1:

        score += 4

    #8 Queens

    if hand[0][3]>=2 and hand[1][3]>=2 and hand[2][3]>=2 and hand[3][3]>=2:

        score += 60

        score += 6

    #8 Jacks

    if hand[0][2]>=2 and hand[1][2]>=2 and hand[2][2]>=2 and hand[3][2]>=2:

        score += 40

        score += 4

    print score