#include <bits/stdc++.h>
using namespace std;
class UnionFind {
 private:
  unsigned size_;
  std::vector<unsigned> par, rank;

 public:
  UnionFind()
      : size_(0), par(std::vector<unsigned>()), rank(std::vector<unsigned>()){};
  UnionFind(unsigned size__) : size_(size__) {
    par.resize(size_);
    rank.resize(size_);
    for (unsigned i = 0; i < size_; i++) par[i] = i, rank[i] = 0;
  }
  unsigned size() { return size_; }
  unsigned root(unsigned x) {
    while (par[x] != x) {
      par[x] = par[par[x]];
      x = par[x];
    }
    return x;
  }
  bool same(unsigned x, unsigned y) { return root(x) == root(y); }
  void unite(unsigned x, unsigned y) {
    x = root(x), y = root(y);
    if (x == y) return;
    if (rank[x] < rank[y])
      par[x] = y;
    else if (rank[x] == rank[y])
      par[y] = x, rank[x]++;
    else
      par[y] = x;
  }
  bool operator==(const UnionFind &u) { return par == u.par; }
  bool operator!=(const UnionFind &u) { return par != u.par; }
};
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  int start_black = -1;
  int total_black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      if (start_black < 0) {
        start_black = i;
      }
      total_black++;
    }
  }
  int min_ = N - start_black - total_black;
  if (start_black < 0) {
    min_--;
  }
  min_ = min(min_, total_black);
  cout << min_ << endl;
  return 0;
}
