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 n = N; int answer = 0; int count = 0; int a = 1; while (true) { if(n < 1) { break; } n = n / 10; count++; } for (int i = 1; i <= count; i++) { answer += (N % 7) * a; N = N / 7; a *= 10; } Console.WriteLine(answer); } } }