n=gets.to_i pattern = 0 34.times do |pgCount| 21.times do |tCount| (tCount+1).times do |gCount| if n == pgCount * 3 + tCount * 5 + gCount * 2 pattern += 1 break end end end end puts pattern