#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using dou = long double;
string yes = "yes";
string Yes = "Yes";
string YES = "YES";
string no = "no";
string No = "No";
string NO = "NO";
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;
}
const long long mod = 1000000007ll;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }
long long ceil(long long a, long long b) { return ((a + b - 1) / b); }
const int INF = 2000000000;
const long long INF64 = 9223372036854775ll;
const long long MOD = 1000000007ll;
const long long OD = 1000000000000007ll;
const dou pi = 3.141592653589793;
long long modpow(long long a, long long n) {
  long long resize = 1;
  while (n > 0) {
    if (n & 1) resize = resize * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return resize;
}
int main() {
  int n;
  std::cin >> n;
  string s;
  std::cin >> s;
  string ss(s);
  reverse((ss).begin(), (ss).end());
  std::vector<int> cc(n + 1), c(n + 1);
  for (long long i = 0; i < (long long)(n); i++) {
    c[i + 1] = c[i];
    if (s[i] == '#') c[i + 1]++;
  }
  for (long long i = 0; i < (long long)(n); i++) {
    cc[i + 1] = cc[i];
    if (s[i] == '.') cc[i + 1]++;
  }
  int ans = INF;
  for (long long i = 0; i < (long long)(n + 1); i++) {
    chmin(ans, c[i] + cc[n - i]);
  }
  std::cout << ans << std::endl;
}
