using System; public class Program { public static void Main() { var input = int.Parse(Console.ReadLine()); Console.WriteLine("285714".Substring((input - 1) % 6, 1)); return; } }