from strutils import split, parseInt, parseFloat
from sequtils import map

import macros
macro unpack*(input: seq; count: static[int]): untyped =
  result = quote do: ()
  when NimMinor <= 13: # 本当にここが区切りかどうかは知らない
    for i in 0..<count: result[0].add quote do: `input`[`i`]
  else:
    for i in 0..<count: result.add quote do: `input`[`i`]

# count == 0 のとき unpackしない
# count >  0 のとき count個分 unpack した結果の tuple を返す
type UnselectableTypeError = object of Exception
template input*(typ: typedesc; count: static[Natural] = 0): untyped =
  let line = stdin.readLine.split
  when count == 0:
    when typ is int:    line.map(parseInt)
    elif typ is float:  line.map(parseFloat)
    elif typ is string: line
    else: raise newException(UnselectableTypeError, "You selected a type other than int, float or string")
  else:
    when typ is int:    line.map(parseInt).unpack(count)
    elif typ is float:  line.map(parseFloat).unpack(count)
    elif typ is string: line.unpack(count)
    else: raise newException(UnselectableTypeError, "You selected a type other than int, float or string")

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
from sequtils import mapIt, filterIt, deduplicate

let
  _ = input(int, 1)
  a = input(int, 0).mapIt(it div 400)
  over = a.filterIt(it >= 8)
  under = a.deduplicate.filterIt(it < 8)

echo under.len, " ", under.len + over.len
