#include using namespace std; int N; string S; int main() { cin>>N>>S; int c=-1,l=0; for(int i=N;i--;)if(S[i]=='#') { c+=2; l=min(l,c-(N-i)); } cout<