#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 ans = inf;
  for (int i = 0; i < (n); ++i) {
    int count = 0;
    for (int j = i; j < (n); ++j) {
      if (s[j] == '.') count++;
    }
    if (i > 0) {
      for (int j = i - 1; j >= 0; j--) {
        if (s[j] == '#') count++;
      }
    }
    ans = min(ans, count);
  }
  cout << ans << endl;
}
