import javax.script.ScriptException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws ScriptException {
Scanner sc = new Scanner(System.in);
while (sc.hasNextInt()) {
System.out.println(test(sc.nextInt()));
}
}
public static int test(int x) { // x 行数
for (int i = 1; i <= x; i++) {
if (F(x, i) % 2 == 0) {
return i;
}
}
return -1;
}
public static int F(int x, int y) { // x 行数,y位置
if (y > 2 * x - 1) {
return 0;
}
if (y <= 0) {
return 0;
}
if (x <= 0) {
return 0;
}
if (x == 1) {
return 1;
}
if (y == 1) {
return 1;
}
return F(x - 1, y - 1) + F(x - 1, y - 2) + F(x - 1, y);
}
}