implicit none integer(8) i,j character(100) moji character(100) suchi integer(8),allocatable :: x(:) allocate (x(100)) 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