t=0;t+=(n=10**I%9995)-t%n*2while I="IXCMVLD"=~/#{getc.chr}/;p t t=0;t+=(n=10**I%9995)-t%n*2while I="IXCMVLD".index(getc);p t