#include <bits/stdc++.h>
using namespace std;
template <typename T>
void view(T e) {
  std::cout << e << std::endl;
}
template <typename T>
void view(const std::vector<T>& v) {
  for (const auto& e : v) {
    std::cout << e << " ";
  }
  std::cout << std::endl;
}
template <typename T>
void view(const std::vector<std::vector<T> >& vv) {
  for (const auto& v : vv) {
    view(v);
  }
}
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int MOD = 1000000007;
const int INF = 1e9;
const int mod = 1000000007;
const int inf = 1e9;
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int ddx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
int ddy[8] = {0, 1, -1, 0, 1, -1, 1, -1};
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt1 = 0, cnt2 = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') break;
    cnt1++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') cnt2++;
  }
  int ans = INF;
  chmin(ans, cnt2 - cnt1);
  chmin(ans, cnt2);
  chmin(ans, n - cnt2);
  cout << ans << endl;
}
