#include <bits/stdc++.h>
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int ny, nx;
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long m, long long n) {
  if ((0 == m) || (0 == n)) return 0;
  return ((m / gcd(m, n)) * n);
}
long long llpow(long long x, long long y) {
  long long ans = 1;
  for (int i = 0, i_len = (y); i < i_len; ++i) ans *= x;
  return ans;
}
long long llmin(long long x, long long y) { return x < y ? x : y; }
long long llmax(long long x, long long y) { return x > y ? x : y; }
unsigned GetDigit(unsigned num) { return to_string(num).length(); }
template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v) {
  return (c.end() != std::find(c.begin(), c.end(), v));
}
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;
}
long long nCr(int n, int r) {
  if (n == r or n == 0) return 1;
  if (n < r) return 0;
  if (r == 1) return n;
  return nCr(n - 1, r - 1) + nCr(n - 1, r);
}
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int WtoB = 0, BtoW = 0;
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    if (S[i] == '#') {
      for (int j = (i + 1); j < (N); ++j) {
        if (S[j] == '.') WtoB++;
      }
      break;
    }
  }
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.') {
      for (int j = i - 1; j >= 0; --j) {
        if (S[j] == '#') BtoW++;
      }
      break;
    }
  }
  cout << min(WtoB, BtoW) << endl;
  return 0;
}
