# Votes  collects voting for a four-candidate election
#  input:  a sequence of votes in the range, 0 to 3, one per line
#  output: the total votes for each of candidates 0,1,2,3

votes = 4 * [0]   # list that holds the totals

# collect the votes:

processing = True
while processing :
    # invariant:  all votes typed are correctly totalled in  votes
    v = int(raw_input("Type your vote (0,1,2,3): "))
    if v < 0  or  v > 3 :
        processing = False   # bad vote, so quit
    else :
        votes[v] = votes[v] + 1


# print the totals:

count = 0
while count < len(votes) :
    print "Candidate", count, "has", votes[count], "votes"
    count = count + 1

print
raw_input("press Enter")