#include <stdio.h>
#include <stdlib.h>


// TODO: Implement a helper named check_permissions that matches the prototype below.
int check_permissions(char *per1, char *per2){
    int i;
    for(i = 0; i <9; i++){
       if(per2[i] != '-' && per2[i] != per1[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;
    }else{
    int count = 0;
    int num;
    char per[9];
    // TODO: Process command line arguments.
    ;
    // TODO: Call check_permissions as part of your solution to count the files to
    // compute and print the correct value.
    while(scanf("%d %s", &num, per) != EOF){
        if(argc ==2 && *argv[1] >= num){
            count += 1;
        }
        if(argc == 3 && *argv[1] >= num && check_permissions(per, argv[2]) == 0){
            count += 1;
        }
    }
    printf("%d\n", count);
    return 0;
    }
}


prints the number of files with a specific set of permissions that exceed a specified size