      program cntssn0
C...............................................Nov 2022
C cnt SSN=0
C
      CHARACTER*64 infile,outfile
C
      infile='SSNd.txt'
	outfile='cntssn0.txt'
	ndy=0
	OPEN(10,file=infile,action='READ')
	OPEN(11,file=outfile)
   30 format(I4,2(1X,I2),1X,F8.3,1X,I4)
   31 format(F8.3,1X,I3,2(1X,I2),1X,I4)
   
C
    1	read(10,30,end=50) iyear,imn,idy,ryear,issn2
	if (issn2.gt.0) then
	goto 1
	               else
	ndy=ndy+1
	 iyr=iyear-iyear/100*100
	lda=ndoy(iyr,imn,idy)
	write(*,31)	ryear,lda,imn,idy,ndy
	write(11,31) ryear,lda,imn,idy,ndy
	goto 1
	endif
   50 close(10)
      close(11)
	pause ' '
	STOP
	 END

     