#include <bits/stdc++.h>
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF = (long long)1E17;
long mod(long a) {
  long long c = a % (long long)(1E9 + 7);
  if (c >= 0) return c;
  return c + (long long)(1E9 + 7);
}
using namespace std;
bool prime_(int n) {
  if (n == 1) {
    return false;
  } else if (n == 2) {
    return true;
  } else {
    for (int i = 2; i <= sqrt(n); i++) {
      if (n % i == 0) {
        return false;
      }
    }
    return true;
  }
}
long long gcd_(long long a, long long b) {
  if (a < b) {
    swap(a, b);
  }
  if (a % b == 0) {
    return b;
  } else {
    return gcd_(b, a % b);
  }
}
long long lcm_(long long x, long long y) { return (x / gcd_(x, y)) * y; }
class UnionFind {
 public:
  vector<int> Parent;
  UnionFind(int N) { Parent = vector<int>(N, -1); }
  int root(int A) {
    if (Parent[A] < 0) return A;
    return Parent[A] = root(Parent[A]);
  }
  int size(int A) { return -Parent[root(A)]; }
  bool connect(int A, int B) {
    A = root(A);
    B = root(B);
    if (A == B) {
      return false;
    }
    if (size(A) < size(B)) swap(A, B);
    Parent[A] += Parent[B];
    Parent[B] = A;
    return true;
  }
};
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int w_cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      w_cnt++;
    } else {
      break;
    }
  }
  int b_cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      b_cnt++;
    }
  }
  int last_b = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      last_b++;
    } else {
      break;
    }
  }
  int ans;
  ans = min(n - w_cnt - b_cnt, b_cnt - last_b);
  cout << ans << endl;
  return 0;
}
