#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int allBlack = 0;
  int allWhite = 0;
  int split = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '.') allBlack++;
  }
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#') allWhite++;
  }
  for (int i = n - 1; i > 0; --i) {
    if (s[i] == '.')
      split++;
    else
      break;
  }
  int turnB = 0;
  int turnW = 0;
  for (int i = 0; i < s.length() - split - 1; ++i) {
    if (s[i] == '#') turnB++;
  }
  for (int i = 0; i < s.length() - split - 1; ++i) {
    if (s[i] == '.') turnW++;
  }
  split = split + min(turnW, turnB);
  cout << min({allBlack, allWhite, split}) << endl;
}
