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