#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 100100100;
int gcd(int a, int b) {
  int c;
  if (a < b) {
    a += b;
    b = a - b;
    a -= b;
  }
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int lcm(int m, int n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
bool isOK(int index, int key, vector<int> a) {
  if (a[index] >= key)
    return true;
  else
    return false;
}
int meguru_binary_search(int key, vector<int> A) {
  int ng = -1;
  int ok = (int)A.size();
  while (abs(ok - ng) > 1) {
    int mid = (ok + ng) / 2;
    if (isOK(mid, key, A))
      ok = mid;
    else
      ng = mid;
  }
  return ok;
}
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count1 = 0, count2 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      count1++;
    else if (s[i] == '#')
      count2++;
  }
  int preans = 2000000, num = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    if (s[i] == '#') {
      num++;
      for (int j = 0; j < n; j++) {
        if (s[i] == '.') count++;
      }
      preans = count < preans ? count : preans;
    }
  }
  int ans;
  ans = count1 < count2 ? count1 : count2;
  ans = preans + num < ans ? preans + num : ans;
  cout << ans << endl;
}
