#include <stdio.h>
#include <string.h>

int readLine(char text[], size_t capacity) {
    if (fgets(text, (int)capacity, stdin) == NULL) return 0;
    size_t length = strlen(text);
    if (length > 0 && text[length - 1] == '\n') text[--length] = '\0';
    else if (!feof(stdin)) {
        int ch = getchar();
        if (ch != '\n' && ch != EOF) return 0;
    }
    if (length > 0 && text[length - 1] == '\r') text[length - 1] = '\0';
    return 1;
}

int main(void) {
    char text[256], character[8];
    int position = -1;
    if (!readLine(text, sizeof text) || !readLine(character, sizeof character) ||
        strlen(character) != 1) {
        puts("Invalid input."); return 1;
    }
    for (int i = 0; text[i] != '\0'; ++i) {
        if (text[i] == character[0]) { position = i + 1; break; }
    }
    printf("Position: %d\n", position);
    return 0;
}
