let t = Int(readLine()!)! if t > 6 { print((t - 6) * 7 + 6) } else { print(t) }