#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int tob = 0, tow = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.')
      tob++;
    else
      tow++;
  }
  for (int i = 0; i < (n); i++) {
    if (s[i] == '#') break;
    tob--;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') break;
    tow--;
  }
  cout << min(tob, tow) << endl;
  return 0;
}
