#include "stdio.h"
#include "sys/types.h"
#include "utmp.h"

main()
{
	struct utmp utmp;
	register struct utmp *pu;
	register short u;
	register FILE *fp;

	u = 0;
	if((fp = fopen(UTMP_FILE, "r")) == NULL){
		fprintf(stdout, "0\n");
		exit(0);
	}
	pu = &utmp;
	while(fread(pu, sizeof (struct utmp), 1, fp) == 1){
		if(pu->ut_type == USER_PROCESS)
			u++;
	}
	fclose(fp);
	fprintf(stdout, "%d\n", u);
	exit(u);
}
