import java.util.*

fun main(args: Array<String>) {
    multipleOf2AndN()
}

private const val TWO = 2L

fun multipleOf2AndN() {
    val n = Scanner(System.`in`).nextLong()
    val result = n * TWO / gcd(n, TWO)

    println(result)
}

private tailrec fun gcd(m: Long, n: Long): Long {
    if (m < n) return gcd(n, m)
    if (n.toInt() == 0) return m
    return gcd(n, m % n)
}
