using System.Linq;using L=System.Console;class C{static void Main(){L.WriteLine(477-L.ReadLine().Sum(c=>c));Main();}}