# frozen_string_literal: true n = gets.chomp.to_i p 2 * (Rational(n / 3).floor + Rational(n / 5).floor)