#include<iostream>
#include<string.h>
#include<conio.h>
using namespace std;
int main()
{
	char Ebarat[51];
	int n=0, i;
	cout << "Ebarat-ha ra vared konid : " << endl;
	for(;;)
	{
		cin >> Ebarat;
		if(strcmp(Ebarat, "TAMAM") == 0)
			break;
		for(i = 0; Ebarat[i] != NULL; i++)
			if(Ebarat[i] >= '0' && Ebarat[i] <= '9')
				n++;
	}
	cout << "Tedad Horof adadi = " << n;
	getch();
}

