#include <bits/stdc++.h>
using namespace std;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int, long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;
using U = unordered_map<int, long long>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  string s, tmp;
  cin >> n;
  cin >> s;
  long long ans = 1000000000000000000 + 10;
  for (int i = 0; i < s.size() + 1; i++) {
    tmp = "";
    m = 0;
    for (int j = 0; j < i; j++) {
      tmp += ".";
    }
    for (int j = 0; j < n - i; j++) {
      tmp += "#";
    }
    for (int j = 0; j < n; j++) {
      m += (s[j] != tmp[j]);
    }
    ans = min(m, ans);
  }
  cout << ans << endl;
}
