object Main {
    def st(n: Double, i: Int): Stream[Double] =
        if (i % 2 == 0) n #:: st(n * 2, i + 1)
        else n #:: st(n / 3, i + 1)

    def main(args: Array[String]) = {
        val in = io.Source.stdin.getLines.map(_.toDouble)
        in.foreach(d => println(st(d, 0).take(10).sum))
    }
}