#include <bits/stdc++.h>
using ll = long long;
using v_int = std::vector<int>;
using v2_int = std::vector<v_int>;
using v_ll = std::vector<ll>;
using v2_ll = std::vector<v_ll>;
using v_string = std::vector<std::string>;
using v_bool = std::vector<bool>;
using v2_bool = std::vector<v_bool>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;
const double PI = 3.1415926535897932;
const int INF = (int)1e9;
const ll LINF = (ll)1e18;
const ll MOD = 1000000007;
const int dr[4] = {1, 0, -1, 0};
const int dc[4] = {0, 1, 0, -1};
using namespace std;
template <typename T, typename U>
inline ostream &operator<<(ostream &o, pair<T, U> &p) {
  return o << "{" << p.first << "," << p.second << "}";
}
template <typename T, typename U, typename V>
inline ostream &operator<<(ostream &o, tuple<T, U, V> &p) {
  return o << "{" << get<0>(p) << "," << get<1>(p) << "," << get<2>(p) << "}";
}
template <typename T>
inline istream &operator>>(istream &is, vector<T> &v) {
  int len = (int)v.size();
  for (int i = 0; i < len; i++) {
    is >> v[i];
  }
  return is;
}
template <typename T>
inline ostream &operator<<(ostream &os, vector<T> &v) {
  int len = (int)v.size();
  for (int i = 0; i < len; i++) {
    os << v[i];
    if (i != len - 1) {
      os << ",";
    }
  }
  return os;
}
template <typename T>
inline void chmin(T &a, T b) {
  a = min(a, b);
}
template <typename T>
inline void chmax(T &a, T b) {
  a = max(a, b);
}
int main(void) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = INF;
  for (int i = (int)(0); i <= (int)(n); i++) {
    int b = 0, w = 0;
    for (int j = 0; j < (int)(i); j++) {
      if (s[j] == '#') {
        b++;
      }
    }
    for (int j = (int)(i); j <= (int)(n - 1); j++) {
      if (s[j] == '.') {
        w++;
      }
    }
    chmin(ans, b + w);
  }
  cout << ans << endl;
  return 0;
}
