character*10000::str character::c integer::cnum integer::sum=0 data str/""/ read *,str do i=1,len_trim(str) c = str(i:i) if (c < '0' .or. c > '9') then str(i:i)='0' end if end do do i=1,len_trim(str) read (str(i:i),*) cnum sum = sum + cnum end do print '(i0)',sum end program