#include #include #include using namespace std; int main(){ int n; cin >> n; string s; cin >> s; int ans = -1001001001; for(int i = n-1; i >= 0; i--){ if(s[i] == '#') ans = max(ans+2, n-i); } cout << ans << endl; return 0; }