import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    long[] alpha_count(long[] alphabets){
        while(!stack.isEmpty()) {
            char now = stack.poll();
            if(now == ')') {
                alphabets = alpha_count(alphabets);
            } else if (now == '')
            
            
        }
    }
    
    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String S = br.readLine();
        int N = S.length();

        Stack<Character> stack = new Stack<>();
        for (int i=0; i<N; i++) {
            stack.push(S.charAt(i));
        }

        long[] subAlphabets = new long[N];
        while(!stack.isEmpty()) {
            char now = stack.poll();
            
            
        }

        
        
        long[] alphabets = new long[N];
        
        for (int i=0; i<N; i++) {
            for (int j=0; j<26; j++) {
                int k = j+97;
                char c = (char) k;
                if(S.charAt(i) == c) {
                    alphabets[j] += 1; 
                    break;
                }
            }
        }
        
        for (int j=0; j<26; j++) {
            int k = j+97;
            char c = (char) k; 
            System.out.println(c + " " + alphabets[j]);
        }

        

        
        
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: