#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VD = vector<double>;
using VLL = vector<ll>;
using VS = vector<string>;
using VC = vector<char>;
using VB = vector<bool>;
const int MOD = 1000000007;
const int INF = 1000000000;
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 (b < a) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = n + 1;
  for (int i = (0), i_len = (n); i <= i_len; ++i) {
    int cnt = 0;
    for (int j = (0), j_len = (i); j < j_len; ++j)
      if (s[j] == '#') ++cnt;
    for (int j = (i), j_len = (n); j < j_len; ++j)
      if (s[j] == '.') ++cnt;
    chmin(ans, cnt);
  }
  cout << ans << "\n";
  return 0;
}
