#include <bits/stdc++.h>
using namespace std;
int countChar(string S, int head, int tale, char c) {
  int cnt = 0;
  for (int(i) = (head); (i) < (tale); ++(i)) {
    if (S[i] == c) cnt++;
  }
  return cnt;
}
int main() {
  int N, min = INT32_MAX;
  string S;
  cin >> N >> S;
  for (int(i) = (0); (i) < (N + 1); ++(i)) {
    min = ((min) < (countChar(S, 0, i, '#') + countChar(S, i, N, '.')))
              ? (min)
              : (countChar(S, 0, i, '#') + countChar(S, i, N, '.'));
  }
  cout << (min) << endl;
  return 0;
}
