using System; namespace yukicoder { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); int ans = 0; ans = 2017 - a; Console.WriteLine(ans); } } }