#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, i, j;
  cin >> n;
  cin >> s;
  j = -1;
  for (i = 0; i < n; i++) {
    if (s[i] == '#')
      j = max(0, j);
    else
      j = j == -1 ? -1 : j + 1;
  }
  cout << max(0, j);
  return 0;
}
