(define (iota n . args) (let ((start (if (pair? args) (car args) 0)) (step (if (and (pair? args) (pair? (cdr args))) (cadr args) 1))) (let loop ((m n) (last (+ start (* step (- n 1)))) (a '())) (if (zero? m) a (loop (- m 1) (- last step) (cons last a)))))) (define (count-same a) (let ((head (car a))) (let loop((b a) (res 0)) (if (null? b) res (if (= head (car b)) (loop (cdr b) (+ res 1)) res))))) (define (solve a) (let loop((b (sort a <)) (res 0)) (if (null? b) res (let ((cnt (count-same b))) (loop (drop b cnt) (if (= cnt 1) (+ res 1) res)))))) (display (solve (let ((N (read))) (map (lambda (x) (read)) (iota N))))) (newline)