#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans1, ans2;
  ans1 = ans2 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') ans1++;
  }
  int key;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      key = i;
      break;
    }
  }
  for (int i = key; i < N; i++) {
    if (S[i] == '.') ans2++;
  }
  int ans4;
  ans4 = min(ans1, ans2);
  int ans3;
  vector<int> ans(N, 0);
  int j = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i; j < N; j++)
      if (S[j] == '.') ans[i]++;
    for (int k = i; k >= 0; k--)
      if (S[k] == '#') ans[i]++;
  }
  ans3 = S[0];
  for (int i = 1; i < N; i++) {
    if (ans[i] < ans3) ans3 = ans[i];
  }
  cout << min(ans4, ans3) << endl;
  return 0;
}
