import java.util.*;enum N{N;System z;long n;{for(Scanner r=new Scanner(z.in);r==r;z.out.println(n*15/8-(45>>n%8)%2))n=r.nextInt();}}