num=list(map(int,input().split()))#先以空格分開輸入n=sum(num)#num總和if n%len(num)!=0:#取餘數對照學生的座號 print(n%len(num))else: print(len(num))