import java.util.Scanner;
import java.awt.*;
public class exercise2
{
public static void main(String[ ] args)
{
Scanner scan=new Scanner(System.in);
int i,n=0;
System.out.println("Type in a character string to be searched:");
System.out.print(">");
String a=scan.next();
System.out.println("Type in the character to be counted.");
System.out.print(">");
String b=scan.next();
for(i=0;i<a.length();i++)
{
char c = a.charAt(i);
char d = b.charAt(0);
if(c==d);
n=n+1;
}
System.out.println("The letter a occurs " + n + " time in the string.");
}
}