#include <bits/stdc++.h>
using namespace std;
template <typename T>
T Abs(T first) {
  return (first < 0 ? -first : first);
}
template <typename T>
T Sqr(T first) {
  return (first * first);
}
const int INF = (int)1e9;
const long double EPS = 1e-12;
const long double PI = acos(-1.0);
bool s[200010];
int n;
int main() {
  cin >> n;
  char first;
  int count = 0;
  for (int i = 0; i < n; i++) {
    cin >> first;
    if (first == '#') {
      s[i] = true;
      count++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i]) {
      count--;
      n--;
    } else
      break;
  }
  int ans = (count > n / 2) ? n - count : count;
  cout << ans << endl;
}
