def calculatescore(mydi,codi):
count=0
for it in mydi:
if it in codi:
if mydi[it]==codi[it]:
count+=1
if abs(len(mydi)-len(codi))>0:
count=-1
return count
student_answers = {1: "A", 2: "B", 3: "C", 4: "D", 5: "E"}
correct_answers = {1: "A", 2: "B", 3: "A", 4: "D", 5: "B"}
print(calculatescore(student_answers, correct_answers))