#include <iostream>
#include<iomanip>
using namespace std;

int main()
{
	const int NUM_DIVS = 3;
	const int NUM_QTRS = 4;
	double sales [NUM_DIVS][NUM_QTRS];
	double totalsales=0;
	int div,qtr;
	
	cout<<"This program will calculate the total sales of all ";
	cout<< "the compony's divisions.\n";
	cout<<"Enter the following sales information: \n\n";
	
	for(div=0;div<NUM_DIVS;div++)
	{
		for(qtr=0;qtr<NUM_QTRS;qtr++)
		{
			cout<<"Division "<<(div+1);
			cout<<" , Quarter "<<(qtr+1)<<": $ ";
			cin>>sales [div][qtr];
		}
		cout<<endl;
	}
	
	for(qtr=0;qtr<NUM_QTRS;qtr++)
	{
		
		if(qtr==2)
		{
			for(div=0;div<NUM_DIVS;div++)
			totalsales +=sales[div][qtr];
		}
		
	}
	
	cout<<fixed<<showpoint<<setprecision(2);
	cout<<"The total sales for the 3rd quarter is : "<<totalsales<<endl;
	return 0;
}
