#import <Foundation/Foundation.h>

int main() {
    @autoreleasepool {
        long N;
        scanf("%ld", &N);
        NSMutableDictionary *dic = [NSMutableDictionary dictionary];
        for (long i=0;i<N;i++) {
            long a;
            scanf("%ld", &a);
            NSNumber *count = [dic objectForKey:@(a)];
            [dic setObject:@(count ? count.integerValue+1 : 1) forKey:@(a)];
        }
        NSInteger count = 0;
        for (NSNumber *num in dic) {
            NSInteger i = num.integerValue;
            NSInteger a = [[dic objectForKey:num] integerValue];
            count += (a>=i) ? (a-i) : a;
        }
        printf("%ld", count);
    }
}

