#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int findGCD(int arr[], int n) {
  int result = arr[0];
  for (int i = 1; i < n; i++) result = gcd(arr[i], result);
  return result;
}
template <typename T>
T lcm(T m, T n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  fill((T *)array, (T *)(array + N), val);
}
int dx[5] = {1, 0, -1, 0};
int dy[5] = {0, 1, 0, -1};
struct edge {
  int cost, to;
  edge(int in_cost, int in_to) {
    cost = in_cost;
    to = in_to;
  }
  bool operator<(const edge &a) const { return cost > a.cost; }
};
int b_to_w[200010];
int w_to_b[200010];
int main() {
  int N;
  Fill(b_to_w, 0);
  Fill(w_to_b, 0);
  string S;
  cin >> N;
  cin >> S;
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == '#') {
      b_to_w[i + 1] = b_to_w[i] + 1;
    } else {
      b_to_w[i + 1] = b_to_w[i];
    }
  }
  for (int i = N; i >= 1; i--) {
    if (S[i] == '.') {
      w_to_b[i] = w_to_b[i + 1] + 1;
    } else {
      w_to_b[i] = w_to_b[i + 1];
    }
  }
  int minimum = (1 << 30);
  for (int i = 1; i <= N; i++) {
    minimum = min(minimum, b_to_w[i] + w_to_b[i]);
  }
  cout << minimum << endl;
  return 0;
}
