#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int black = 0, white = 0;
  for (int i = 0; i < (n); i++) {
    if (s.at(i) == '.')
      white++;
    else
      black++;
  }
  if (s.at(0) == '.' || s.at(n - 1) == '#') {
    int i = 0;
    while (s.at(i) == '.') {
      white--;
      i++;
    }
    int j = n - 1;
    while (s.at(j) == '#') {
      black--;
      j--;
    }
  }
  int ans = min(white, black);
  cout << ans << endl;
}
