namespace ConsoleApplication1
public static void Main()
Console.WriteLine("Please enter the height of the column.(-1 will be the last column)");
int CurrentColumnHeight = 0;
int LastHeigestColumn = 0;
CurrentColumnHeight = Convert.ToInt32(Console.ReadLine());
while (CurrentColumnHeight != -1)
if (LastHeigestColumn < CurrentColumnHeight)
LastHeigestColumn = CurrentColumnHeight;
Output = Output + (LastHeigestColumn - CurrentColumnHeight);
CurrentColumnHeight = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Output = " + Output);