This code is supposed to remove the first line from stdin, then add the numbers from a line if the lines do not begin with a 'd'. However, it does not do this. What is wrong?
int main(int argc, char** argv) {
    if (!(argc == 2 || argc == 3)) {
        fprintf(stderr, "USAGE: count_large size [permissions]\n");
        return 1;
    }

    int count = 0;
    char *required_permissions;
    int lower_bound = strtol(argv[1], NULL, 10);
    if (argc == 3){
        required_permissions = argv[2];
    }
    // Skipping the first line
    scanf("%*[^\n]");
    char permissions[11];
    char str_size[6];
    char directory;
    while (-1 != scanf("%c%s %*s %*s %*s %s %*s %*s %*s %*s", &directory, permissions, str_size)) {
        if (directory != 'd') {
            int size = strtol(str_size, NULL, 10);
        
            if (size > lower_bound) {
                count ++;
            }
        }
    }

    printf("%d", count);
    return 0;
}
