public class Section055 {
	public static void main(String[] args) {
		int i, j, k, nmg;
		i = 0;
		A:	
		while (true)
		{
			i++;
			j = i;
			for (k = 1; k <= 5; k++)
			{
				nmg = j - j / 4 * 4;
				if (nmg != 1)
					break;
				j--;
				j = j * 3 / 4;
				if(k == 5)
					break A;
			}
		}
		System.out.printf("%d", i);
	}
}
