$<.readlines.map(&:to_f).each do |x|
  sum = 0
  solve = ->(n, i = 1) {
    sum += n
    return sum if i == 10
    (i + 1).even? ? solve.(n * 2.0, i + 1) : solve.(n / 3.0, i + 1)
  }
  puts solve.(x)
end
