#include <bits/stdc++.h>
using namespace std;
using ul = unsigned long;
using ll = long long;
using ld = long double;
using vint = vector<int>;
using vll = vector<ll>;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using vpint = vector<pint>;
using vpll = vector<pll>;
const int INF = (int)1e9 + 1;
const int MOD = (int)1e9 + 7;
int n;
string s;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  cin >> s;
  int cnt = 0;
  int ans;
  int cnt_ = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#') cnt++;
  }
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.') cnt_++;
  }
  ans = min(cnt, cnt_);
  for (int k = 0; k < (n); k++) {
    cnt = 0;
    for (int i = 0; i < (k); i++) {
      if (s[i] == '#') cnt++;
    }
    for (int i = (k); i < (n); i++) {
      if (s[i] == '.') cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}
