n=p=0 for c in raw_input(): x={77:1000,68:500,67:100,76:50,88:10,86:5,73:1}[ord(c)] if p