/*
getstrn.c: read a specified numbers of chars from stdin
*/

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv)
	{
	int c;
	if (argc==2)
		{
		int i;
		int n=atoi(argv[1]);
		for (i=0; i<n; i++)
			{
			if (EOF != (c=getchar())) putchar(c);
			}
		}
	else
		{
		while (EOF != (c=getchar())) putchar(c);
		}
	return 0;
	}