implicit none integer(8) i,j character(10000) moji character(10000) suchi integer(8),allocatable :: x(:) allocate (x(10000)) read(*,*) moji x=0 do i=1,len(moji) if (moji(i:i) >= '1' .and. moji(i:i) <= '9') then suchi=moji(i:i) read(suchi,*) j x(i)=j end if end do write(*,*) sum(x) end