import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long n = sc.nextLong(); long x = 1; while (n > x) { if ((n & x) != 0) { n ^= x; } x <<= 1; } System.out.println(n); } }