#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
string join(const T &v, const string delim = ",") {
  if (v.empty()) return "";
  ostringstream res;
  res << v[0];
  for (int i = 1; i < v.size(); i++) {
    res << delim << v[i];
  }
  return res.str();
}
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int w = 0;
  for (ll i = (ll)(0); i < (ll)(N); i++)
    if (S[i] == '.') w++;
  int ans = min(w, N - w);
  int l = 0;
  while (l < N && S[l] == '.') l++;
  int r = N - 1;
  while (r >= 0 && S[r] == '#') r--;
  int w2 = 0;
  for (int i = l; i <= r; i++) {
    if (S[i] == '.') w2++;
  }
  chmin(ans, w2);
  chmin(ans, (r - l + 1) - w2);
  cout << ans << endl;
}
