#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int countb = 0;
  int countw = 0;
  int M = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      countb++;
    }
    if (S.at(i) == '.') {
      countw++;
    }
    if (M <= countb - countw) {
      M = countb - countw;
    }
  }
  cout << M << endl;
}
