import java.util.*;
class Main{
public void DecimalToOctalNumber() {
Stack<Integer> stack= new Stack<Integer>();
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
while (n!=0) {
stack.push(n%8);
n = n/8;
}
while(!stack.isEmpty()){
int m = stack.pop();
System.out.print(m);
}
}
}