#include <bits/stdc++.h>
template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
inline T intceil(T a, T b) {
  return (a + (b - 1)) / b;
}
using namespace std;
const long long MOD = 1e9 + 7;
const string alphabet = "abcdefghijklmnopqrstuvwxyz";
const int dy[4] = {0, 1, 0, -1};
const int dx[4] = {1, 0, -1, 0};
static const double pi = 3.141592653589793;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int blackCnt = 0;
  int whiteCnt = 0;
  int tmpBlack = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      ++tmpBlack;
    } else {
      blackCnt = tmpBlack;
    }
  }
  int tmpWhite = 0;
  for (int i = 0; i < n; ++i) {
    if (s[n - i - 1] == '.') {
      ++tmpWhite;
    } else {
      whiteCnt = tmpWhite;
    }
  }
  cout << min(whiteCnt, blackCnt) << endl;
}
