#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int MOD = 1000000007;
vector<long long> dx = {0, 1, 0, -1};
vector<long long> dy = {1, 0, -1, 0};
vector<long long> dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
vector<long long> dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};
int main(int argc, char const* argv[]) {
  int n;
  string s;
  cin >> n >> s;
  int front = 0, back = 0;
  bool b = false, w = false;
  for (int i = 0; i < n; i++) {
    if (!b and s[i] == '#') {
      b = true;
    }
    if (b and s[i] == '.') {
      front++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (!w and s[i] == '.') {
      w = true;
    }
    if (w and s[i] == '#') {
      back++;
    }
  }
  cout << min(front, back) << endl;
  return 0;
}
