```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

typedef struct Node {
    char name[51];
    struct Node* next;
} Node;

int main() {
    int N, C, P;
    if (scanf("%d %d %d", &N, &C, &P) != 3) {
        printf("Invalid input\n");
        return 0;
    }
    
    if (N < 10 || N > 200 || C < 1 || C > 20 || P < 1 || P > N) {
        printf("Invalid input\n");
        return 0;
    }

    
    getchar();

    
    char line[5000];
    if (fgets(line, sizeof(line), stdin) == NULL) {
        printf("Invalid input\n");
        return 0;
    }

    
    char *token;
    int count = 0;
    Node *head = NULL, *tail = NULL;

    token = strtok(line, " \n");
    while (token != NULL) {
        count++;
        Node* newNode = (Node*)malloc(sizeof(Node));
        if (!newNode) {
            printf("Invalid input\n");
            return 0;
        }
        strcpy(newNode->name, token);
        newNode->next = NULL;

        if (head == NULL) {
            head = tail = newNode;  
        } else {
            tail->next = newNode;
            tail = newNode;
        }
        token = strtok(NULL, " \n");
    }

    if (count != N) {
        printf("Invalid input\n");
        
        Node *tmp;
        while (head) {
            tmp = head;
            head = head->next;
            free(tmp);
        }
        return 0;
    }

    Node *current = head;
    for (int i = 1; i < P; i++) {
        if (current == NULL) {
            printf("Invalid input\n");
            
            while (head) {
                Node *tmp = head;
                head = head->next;
                free(tmp);
            }
            return 0;
        }
        current = current->next;
    }

    int rounds = (P + C - 1) / C;
    printf("%d\n", rounds);


    Node *tmp;
    while (head) {
        tmp = head;
        head = head->next;
        free(tmp);
    }

    return 0;
}
```