import java. io. * ;
class Capital
{
String sent;
int freq;
Capital ( )
{
sent = " "; freq = 0;
}
void input ( )
{
BufferedReader br = new BufferedReader (new InputStreamReader (System. in));
system. out. println ("Enter one sentence");
sent = br. readLine ( );
String [ ] word = sent. split (" \\ s");
for (int i = 0; i < word. length; i ++)
{
if (isCap (word [i]) = = true)
freq ++;
}
}
boolean isCap (String w)
{
if (Character. isUpperCase (w. charAt (0)) = = true)
return true;
else return false;
}
void display ( )
}
System. out. println (sent);
System. out. println (" the frequency of the words beginning with a capital letter is "+ freq);
}
public static void main ( )
{
Capital Ob = new Capital ( );
Ob. input ( );
Ob. display ( );
}
}