#include <stdio.h>
int main ()
{
	//tarife pointer
	char *c;
	int *i;
	//gereftane fazaye hafeze baraye pointer ha
	c = (char*)malloc(sizeof(char));
	i = (int*)malloc(sizeof(int));

	//pardazesh barname
	*i = 0;
	while ((*c = getch()) != 'p' && *c != 'P')
	{
		printf ("%c", *c);
		(*i)++;
	}
	printf ("\n\nTedad horof type shode = %d", *i);

	//azad sazi fazaye hafeze baraye pointer ha
	free(c);
	free(i);

	getch();
}

