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


// TODO: Implement a helper named check_permissions that matches the prototype below.
int check_permissions(char *, char *);


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

    // TODO: Process command line arguments.
    char Sdud[31];
    int Idud;

    scanf("%s %d", Sdud, &Idud); // Getting rid of the first line of stdin

    int size;
    int count = 0;

    if (argc == 2){
        
        int scanf_return;

        do{
            printf("hi");
            scanf_return = scanf("%s %d %s %s %d %d %s %s %s",
                                 Sdud, &Idud, Sdud, Sdud, &size, &Idud, Sdud, Sdud, Sdud);


            // Stopping the loop from running if stdin is closed
            if (size > strtol(argv[2], NULL, 10)){ 
                count++;
            }
        }
        while(scanf_return != EOF);
    }
    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;
}

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

}
