#![allow(non_snake_case, unused_must_use, unused_imports)] use std::io::{self, prelude::*}; fn main() { let (stdin, stdout) = (io::read_to_string(io::stdin()).unwrap(), io::stdout()); let (mut stdin, mut buffer) = (stdin.split_whitespace(), io::BufWriter::new(stdout.lock())); macro_rules! input { ($t: ty, $n: expr) => { (0..$n).map(|_| input!($t)).collect::>() }; ($t: ty) => { stdin.next().unwrap().parse::<$t>().unwrap() }; } let N = input!(u64); let ans = (1 << N.count_ones()) - 2u64; writeln!(buffer, "{}", ans); }