#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> b(n + 1), w(n + 1);
  int bc = 0, wc = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') bc++;
    if (s[i] == '.') wc++;
    b[i + 1] = bc;
    w[i + 1] = wc;
  }
  int ans = 1e9;
  for (int i = 1; i <= n; i++) {
    ans = min(ans, b[i] + w[n] - w[i]);
  }
  cout << ans << endl;
  return 0;
}
