program main implicit none integer*8::i,j integer*8::N integer*8::a,b,aa,bb integer*8::aaa,bbb integer*8::total=0 read *,N do i=1,INT(sqrt(real(N))) if(MOD(N,i).ne.0) cycle a = i b = N/i aa = a+roundup(a)*b bb = a*roundup(b)+b ! print *, a,b,aa,bb if(aa.eq.bb) then aa = a*roundup(b)*b total = total + 1 else total = total + 2 end if end do print '(i0)', total contains function roundup(a) result(aa) integer*8::a,aa,tmp aa = 1 tmp = a do aa = aa*10 tmp = tmp/10 if(tmp.eq.0) exit end do end function roundup end program main