ires=ires-ishift
c write (2,*) "ires",ires," ishift",ishift
if (res.eq.'ACE') then
ires=ires-ishift
c write (2,*) "ires",ires," ishift",ishift
if (res.eq.'ACE') then
lll=lll+1
cc write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
if (i.gt.1) then
lll=lll+1
cc write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
if (i.gt.1) then
chain_length=lll-1
kkk=kkk+1
c write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)
chain_length=lll-1
kkk=kkk+1
c write (iout,*) "spraw lancuchy",(c(j,i),j=1,3)