s=gets.chop p ((0..s.size).map{|i|$_=s[i,$$]+s[0,i];eval$_.gsub /01/,?1 if /^[+-]|[+-]$/}-[p]).max