Counting the letters (uppercase and lowercase) of a string
===

I have here a program that enters a paragraph and writes it into a file. After that, it should count the occurrences of each letters (case sensitive). However, it doesn't count the number of letter occurrences. I think I put the <code> for</code> loop in the wrong place.

    import java.io.*;
    import java.util.*;
    public class Exercise1 {
    	
    	public static int countLetters (String line, char alphabet) {
    		int count = 0;
    		for (int i = 0; i <= line.length()-1; i++) {
    			if (line.charAt(i) == alphabet)
    				count++;
    		}
    		return count;
    	}
    	
    	public static void main(String[] args) throws IOException {
    		BufferedReader buffer = new BufferedReader (new InputStreamReader(System.in));
    		PrintWriter outputStream = null;
    		Scanner input = new Scanner (System.in);
    		int total;
    		
    		try {
    			outputStream = new PrintWriter (new FileOutputStream ("par.txt"));
    			System.out.println("How many lines are there in the paragraph you'll enter?");
    			int lines = input.nextInt();
    			System.out.println("Enter the paragraph: ");
    			String paragraph = buffer.readLine();
    			outputStream.println(paragraph);
    			int j;
    			for (j = 1; j<lines; j++) {
    				paragraph = buffer.readLine();
    				outputStream.println(paragraph);	
    			}
    			outputStream.close();
    			System.out.println("The paragraph is written to par.txt");
    			
    			for (int k=1; k<lines; k++) {
    				paragraph = buffer.readLine();
    				total = countLetters (paragraph, 'A');
    				if (total != 0)
    					System.out.println("A: "+total);
                                //I'll do bruteforce here up to lowercase z

    			}
    		}
    		
    		catch(FileNotFoundException e) {
    			System.out.println("Error opening the file par.txt");
    		}
    		
    	}
    
    }
    	
Please help me fix the code. I'm new in programming and I need help. Thank you very much!