#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>   // for isdigit()
int main() {
    int n =50;
    // Allocate memory dynamically for n+1 (extra for null terminator if needed)
    char *str = (char *)malloc((n + 1) * sizeof(char));
    // Read the string
    scanf("%s", str);
    // Pointer to traverse
    char *p = str;
    // Validation: check digits
    while (*p != '\0') {
        if (isdigit(*p)) {
            printf("Invalid input\n");
            free(str);
            return 0;
        }
        p++; //at the end p='\0'
    }
    // Reset pointer for processing (from '\0' to str[0])
    *p = str; 
    char minChar = *p; //minChar becomes str[0]
    // Find minimum ASCII character
    while (*p != '\0') {
        if (*p < minChar) {
            minChar = *p;
        }
        p++;
    }
    printf("%c\n", minChar);
    free(str);  // free allocated memory
    return 0;
}