#include<stdio.h>
#include<ctype.h>

int main() {
    char str[101];
    fgets(str, sizeof(str), stdin);
    
    int count[26] = {0};
    int appeared[26] = {0};
    char output[101] = {0};
    int idx = 0;
    
    for(int i = 0; str[i]; i++) {
        if(isalpha(atr[i])) {
            int c = tolower(str[i]) - 'a';
            count[c]++;
            if(!appeared[c]) {
                output[idx++] = toupper(str[i]);
                appeared[c] = 1;
            }
        } else if(!isspace(str[i])) {
            printf("Invalid input\n");
            return 0;
        }
    }
    for(int i = 0; i < idx; i++) {
        int c= tolower(output[i]) - 'a';
        printf("%c%d", output[i], count[c]);
    }
    printf("\n");
    
    return 0;
}