#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; string S; cin>>N>>S; if(N==1){ cout<<"1\n"; return 0; } vectorw(N); int ans=0; for(int i=N-1;i>0;i--){ if(S[i]=='#'){ w[i-1]=w[i]+1; ans=(N-i)+w[i]; }else{ w[i-1]=max(0,w[i]-1); } } if(S[0]=='#'){ ans=N+w[0]; } cout<