#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vin = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;
const int inf = 1e9 + 7;
const ll INF = 1e18;
template <typename T>
void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void chmax(T &a, T b) {
  a = max(a, b);
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sta[2];
  sta[0] = -1;
  sta[1] = -1;
  int cnt[2];
  cnt[0] = 0;
  cnt[1] = 0;
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      sta[0] = i;
      break;
    }
  }
  if (sta[0] >= 0) {
    for (int i = sta[0]; i < (n); ++i) {
      if (s[i] == '.') {
        cnt[0]++;
      }
    }
  }
  reverse((s).begin(), (s).end());
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] == '.' && s[i + 1] == '#') {
      sta[1] = i;
      break;
    }
  }
  if (sta[1] >= 0) {
    for (int i = sta[1]; i < (n); ++i) {
      if (s[i] == '#') {
        cnt[1]++;
      }
    }
  }
  cout << min(cnt[0], cnt[1]) << endl;
}
