#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using namespace std;
bool isPrimeNum(ll x) {
  if (x <= 1) {
    return false;
  }
  int n = (int)sqrt((double)x);
  for (int i = 2; i <= n; i++) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
ll myPow(ll x, ll n, ll m) {
  if (n == 0) return 1;
  if (n % 2 == 0)
    return myPow(x * x % m, n / 2, m);
  else
    return x * myPow(x, n - 1, m) % m;
}
constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
constexpr ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
constexpr ll abs(ll a, ll b) {
  if (a >= b) return a - b;
  if (a < b) return b - a;
}
constexpr ll min(ll a, ll b) {
  if (a >= b) return b;
  if (a < b) return a;
}
constexpr ll max(ll a, ll b) {
  if (a >= b) return a;
  if (a < b) return b;
}
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
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;
  }
};
long long fac[510000], finv[510000], inv[510000];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < 510000; i++) {
    fac[i] = fac[i - 1] * i % 1000000007;
    inv[i] = 1000000007 - inv[1000000007 % i] * (1000000007 / i) % 1000000007;
    finv[i] = finv[i - 1] * inv[i] % 1000000007;
  }
}
long long COM(int n, int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % 1000000007) % 1000000007;
}
int main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll ans = 0;
  ll flag = 0;
  for (int i = (0); i <= (N - 1); i++) {
    if (S[i] == '#') {
      flag = 1;
    }
    if (flag == 1 && S[i] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
