	program orbref_count
c
c	tallies number of "keeper" orbits per person
c
	character*3 ref(1000),ref1
	dimension nno(1000),nyes(1000),ntot(1000),yes(1000)
	character*1 keep
c
	open(10,file='orb6.master',status='UNKNOWN')
	open(11,file='orbref_count.out',status='UNKNOWN')
c
	nn=0
	nnotot=0
	nyestot=0
c
  100	read(10,901,end=500) keep,ref1
  901	format(t250,a1,1x,a3)
	if ((keep .ne. 'y') .and. (keep .ne. 'n')) go to 100
	if (nn .ne. 0) go to 150
	nn=nn+1
	ref(nn)=ref1
	if (keep .eq. 'n') nno(nn)=1
	if (keep .eq. 'y') nyes(nn)=1
	if (keep .eq. 'n') nnotot=nnotot+1
	if (keep .eq. 'y') nyestot=nyestot+1
	go to 100
c
  150	do 200 n=1,nn
	if (ref1 .ne. ref(n)) go to 200
	if (keep .eq. 'n') nno(n)=nno(n)+1
	if (keep .eq. 'y') nyes(n)=nyes(n)+1
	if (keep .eq. 'n') nnotot=nnotot+1
	if (keep .eq. 'y') nyestot=nyestot+1
	go to 100
  200	continue
	nn=nn+1
	ref(nn)=ref1
	if (keep .eq. 'n') nno(nn)=1
	if (keep .eq. 'y') nyes(nn)=1
	if (keep .eq. 'n') nnotot=nnotot+1
	if (keep .eq. 'y') nyestot=nyestot+1
	go to 100
c
  500	do 600 n=1,nn
	ntot(n)=nno(n)+nyes(n)
	yes(n)=100.*float(nyes(n))/float(ntot(n))
	write(11,902) ref(n),nno(n),nyes(n),ntot(n),yes(n)
  902	format(a3,3i6.4,f6.0)
  600	continue
	ntotal=nnotot+nyestot
	yestot=100.*float(nyestot)/float(ntotal)
	write(11,903) nnotot,nyestot,ntotal,yestot
  903	format(/'all',3i6,f6.0)
c
  999	stop
	end

	
