/*
* Name, etc.
*
*/
import java.io.*;
class sixteenC
{
public static void main (String[] args) throws IOException
{
BufferedReader stdin = new BufferedReader (new InputStreamReader (System.in));
String inData;
int length; //length of input String
int temp; //position of character
char character; //what the character is
int howMany = 0; //how many characters were converted
System.out.println("Input stuff, and the program will invert your letter cases.");
System.out.println("Input the period character (.) to end the program.");
do //loop, always runs
{
inData = stdin.readLine(); //reads input, puts into "inData"
length = inData.length(); //calling length method, putting result into "length"
for (temp = 0; temp < length - 1; temp = temp +1); //nested loop, resets temp to zero each input
{
character = inData.charAt(temp); //characters should go through one by one
if (character >= 65 && character <= 90) // is lower case
{
character += 32;
howMany += 1;
}
if (character >= 97 && character <= 122) // is upper case
{
character -= 32;
howMany += 1;
}
System.out.println(character);
} //for loop
} //do loop
while (!(inData.equals("."))); //test for the period, end
System.out.println("Program ending. There were " + howMany + " case inversions.");
} //main
} //class