#coding:utf-8 lamp = 55 lot = 0 get = input() get = get.split(" ") for x in range(0,9): rot = int(get[x]) lot += rot print(abs(lamp - lot))