#include <fstream>
#include <string>
#include <iostream>
#include <math.h>
// ./program in.txt out.txt
// Designed by Peter A Noble, 2011, Alabama State University
// panoble@washington.edu

using namespace std;


int main (int argc, char * const argv[]) {
	ifstream in(argv[1]); 		//probeseq
	ofstream out(argv[2]);		//output
	
	int x=0;
	char id[50];
	int length=0;
	int A=0,C=0,G=0,T=0,N=0,TOTAL=0;
	double GC;
	char nucl[5000];
	char garbage[50];
	//out << "id\t" << "GC\t" << "TOTAL\n";
	cout << "id\t" << "GC\t" << "TOTAL\n";

	while(!in.eof())
	{
		in >> id;
		//in >> garbage;
		in >> length;
		for(int d=0;d<(length);d++)
		{	
			in >> nucl[d];	
		}
		
		//A=0,C=0,G=0,T=0,N=0;
		
		for (int s=0;s<length;s++) 	
		{	 
			if ((nucl[s]=='A') || (nucl[s]=='a') ) {A=A+1; }
			if ((nucl[s]=='C') || (nucl[s]=='c') ) {C=C+1; }
			if ((nucl[s]=='G') || (nucl[s]=='G') ) {G=G+1; }
			if ((nucl[s]=='T') || (nucl[s]=='G') ) {T=T+1; }		
			if ((nucl[s]=='N') || (nucl[s]=='n') ) {N=N+1; }		
		}
	}
		TOTAL=A+C+G+T;
		GC=((double)(G+C)/TOTAL);
		std::cout << GC << "\t" << TOTAL << "\n";
		out << GC << "\t" << TOTAL << "\n";

		return 0;
	}