using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int answer = 0; int a = 1; while(true) { answer += (N % 7) * a; if(N % 7 == 0 && N / 7 == 0) { break; } N = N / 7; a *= 10; } Console.WriteLine(answer); } } }