class GraphProblem attr_reader :n def initialize(n: 0) @n = n end def cause begin @n = Integer(gets.chomp) rescue end end def result puts @n - 1 end def run cause result end end if $0 == __FILE__ GraphProblem.new.run end