import java.io.PrintWriter fun main(args: Array) { val pw = PrintWriter(System.out) val n = readLine()?.toInt() ?: 0 val result = (1..n) .toList() .fold( 0, { acc, a -> when { a % 3 == 0 && a % 5 == 0 -> { acc + 4 } a % 3 == 0 -> { acc + 2 } a % 5 == 0 -> { acc + 2 } else -> { acc } } } ) pw.println(result) pw.flush() }