how can i index input to get the first character
int check_permissions(char *permission_field, char *required_permissions) {
    for (int i = 0; i < 9; i++) {
        if (required_permissions[i] == 'w' && permission_field[i] != 'w') {
            return 1;
        } else if (required_permissions[i] == 'r' && permission_field[i] != 'r') {
            return 1;
        } else if (required_permissions[i] == 'x' && permission_field[i] != 'x') {
           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 ls_permissions[10];
    int ls_size;

    scanf("%*s %*d");

    // TODO: Process command line arguments.
    int size = strtol(argv[1], NULL, 10);
    char *input;
    char *permissions = malloc(sizeof(char *) * 9);

    if (argc == 3) {
        input = argv[2];
        for (int i = 0; i < 9; i++) {
            permissions[i] = input[i + 1];
            printf("%sB \n", &input[2]);
        }
    }
int result = 0;

    while (scanf("%s %*d %*s %*s %d %*s %*d %*s %*s", ls_permissions, &ls_size) != EOF) {
        if (input[0] != 'd') {
            if (argc == 2) {
                if (ls_size >= size) {
                    result++;
                }
            } else if (argc == 3 && ls_size >= size && check_permissions(ls_permissions, permissions) == 0) {
                result++;
            }
        }
    }
    //free(permissions);
    printf("%d\n", result);
    free(permissions);
    return 0;
}