int check_permissions(char * file, char * req){
    for (int i = 0; i < 9 ; i++){
    	if (req[i] != '-'){
    	    if (file[i] != req[i]){
    	    	return 1;
    	    }
    	}
    }
    return 0;
}

int main(int argc, char** argv) {
    if (!(argc == 2 || argc == 3)) {
        fprintf(stderr, "USAGE: count_large size [permissions]\n");
        return 1;
    }


    char *after;
    char *before;
    int size;
    int count;
    
    // TODO: Process command line arguments.
    scanf("Total %*d\n");
    while(scanf("%s %d %s\n", before, &size, after) != EOF){
    	if (size > strtol(argv[1], NULL, 10) && before[0] != 'd'){
    	    if (argc == 3){
    	    	if (!check_permissions(before, argv[2])){
    	    	    count ++;
    	    	}
    	    } else{
    	    	count ++;
    	    }
    	}
    }
    printf("%d", count);
    
    // TODO: Call check_permissions as part of your solution to count the files to
    // compute and print the correct value.
    
    return 0;
}