import scala.math.BigInt

object Main extends App {
  
  val sc = new java.util.Scanner(System.in)
  var a, b, c, k = BigInt(sc.nextLong())
  val max = BigInt(1000000000000000000L)
  var i = 1
  while (i <= k && (a+b <= max || a+c <= max || b+c <= max)) {
    val _a = a
    val _b = b
    val _c = c
    a = _b + _c
    b = _a + _c
    c = _a + _b
    i += 1
  }
  if (a - b <= max) {
    println(a - b)
  } else {
    println("Unfair")
  }
}