input.map(&(-> (f) {->(g) {g.(g)}.(->(g) { f.(->(*args) {g.(g).(*args)})})}.(->(f) { ->(n) { n < 9 ? 0 : (n/3-2)+f.(n/3-2) } }))).reduce(&:+)