import scala.io.StdIn @main def yuki2853(): Unit = val n = BigInt(StdIn.readLine) println(BigInt(2).pow(n.bitCount) - 2)