for($=readline(o=i='');i++<99;o=(10+c+~$[$[-1]-i>>>0])%10+o)c=o<1;print(9+c+o)