#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
bool prime(long long a) {
  if (a == 1) return false;
  for (long long i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
struct edge {
  long long to, cost;
};
class dijkstra {
  long long V;
  long long d[100002];
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      que;
  void update(long long s, vector<edge> G[]) {
    fill(d, d + V + 1, 100000000000ll);
    d[s] = 0;
    que.push(make_pair(0, s));
    while (!que.empty()) {
      pair<long long, long long> p = que.top();
      que.pop();
      long long v = p.second;
      if (d[v] < p.first) continue;
      for (long long i = 0; i < G[v].size(); i++) {
        edge e = G[v][i];
        if (d[e.to] > d[v] + e.cost) {
          d[e.to] = d[v] + e.cost;
          que.push(make_pair(d[e.to], e.to));
        }
      }
    }
  }

 public:
  dijkstra(long long v, long long s, vector<edge> G[]) {
    V = v;
    update(s, G);
  }
  long long find(long long e) {
    return d[e];
    ;
  }
};
class Union_Find {
 private:
  vector<long long> t, s;

 public:
  Union_Find(long long max_length) {
    for (long long i = 0; i < max_length + 1; i++) {
      t.push_back(i);
      s.push_back(1);
    }
  }
  void Union(long long x, long long y) {
    if (same(x, y)) return;
    long long tx = Find(x), ty = Find(y);
    if (s[tx] < s[ty]) {
      s[ty] += s[tx];
      t[tx] = ty;
    } else if (s[tx] > s[ty]) {
      s[tx] += s[ty];
      t[ty] = tx;
    } else if (tx > ty) {
      t[tx] = ty;
      s[ty] += s[tx];
    } else {
      t[ty] = tx;
      s[tx] += s[ty];
    }
  }
  long long Find(long long n) {
    if (t[n] == n)
      return n;
    else
      return t[n] = Find(t[n]);
  }
  bool same(long long x, long long y) { return Find(x) == Find(y); }
  long long get_Size(long long a) { return s[a]; }
};
signed main() {
  long long n, memo[200011];
  string s;
  cin >> n >> s;
  long long ans = LLONG_MAX;
  memo[0] = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '.')
      memo[i + 1] = memo[i] + 1;
    else
      memo[i + 1] = memo[i];
  }
  for (long long i = 0; i < n; i++) {
    long long cnt = i + 1 - memo[i + 1] + (memo[n] - memo[i + 1]);
    ans = min(ans, cnt);
  }
  cout << ans << endl;
}
