class Score:
  value = None
  next = None # the "next-link" 
# Score specification ends here

# main program starts here
start = None # create an empty list

# read and save the records
while True:
  aScore = Score() # Step 1, create a node

  # Step 2, read its data fields
  aScore.value = int(input("Enter a score [-1 to quit]: "))
  if (aScore.value == -1): break

  # Step 3, add new node to the list
  aScore.next = start
  start = aScore
       
# traverse the list and get the average
count = 0
total = 0
p = start
while p != None:
  total += p.value
  count += 1
  p = p.next

# output the result
if count > 0:
  average = total / count
  print("The average of", count, "scores is", average)
else:
  print("No values were entered.")