#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int ans = 0;
  vector<int> blackIndex;
  int bCnt = 0;
  for (int i = 0; i < N; ++i)
    if (S[i] == '#') ++bCnt;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#') {
      blackIndex.push_back(i);
      bool flag = false;
      for (int j = i + 1; j < N; ++j) {
        if (S[j] == '.') {
          flag = true;
        } else {
          if (flag) {
            i = j;
            break;
          }
        }
        if (j = N - 1) i = N - 1;
      }
    }
  }
  if (blackIndex.size() == 0) {
    cout << 0 << endl;
  } else {
    vector<int> ans(blackIndex.size(), 0);
    for (int i = 0; i < blackIndex.size(); ++i) {
      for (int j = 0; j < N; ++j) {
        if (S[j] == '#' && j < blackIndex[i]) ++ans[i];
        if (S[j] == '.' && j > blackIndex[i]) ++ans[i];
      }
    }
    sort(ans.begin(), ans.end());
    cout << min(bCnt, ans[0]) << endl;
  }
  return 0;
}
