R=range I=input N=I() dp=[0]*3 for s in I(): if s=='-':dp[0]+=1 elif s=='0':dp[1]=max(dp[0]+1,dp[1]) else:dp[2]=max(dp)+1 print(max(dp))