while true
    n = gets.to_i
    break if n == 0
    arr = gets.chomp.split.map(&:to_i)
    arr2 = [0, 0, 0]
    arr.each{|x| arr2[[x, 2].min] += 1}
    puts (arr2[2] == 0) ? "NA" : arr2[1] + arr2[2] + 1
end
