package Yukicoder fun main(args: Array) { fun readLineLongArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toLong() } return ret } fun readLineLong(): Long { val str = readLine() as String return str.toLong() } fun readLineInt(): Int { val str = readLine() as String return str.toInt() } fun readLineIntArray() : List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toInt() } return ret } fun readLineDoubleArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toDouble() } return ret } fun readLineDouble() : Double { val str = readLine() as String return str.toDouble() } fun readLineString() : String { return readLine() as String } // fun readLineStringArray(): List { // val str = readLine() as String // val arrStr = str.split(" ") // return arrStr // } val num = readLineLong() val offset = when((num % 15).toInt()) { 0,1,2 -> 0 3,4 -> 2 5 -> 4 6,7,8 -> 6 9 -> 8 10,11 -> 10 12,13,14 -> 12 else -> 0 } println((num/15)*16+offset) }