#include <bits/stdc++.h>
using namespace std;
void init() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vd = vector<ld>;
using vs = vector<string>;
using vb = vector<bool>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<ld>>;
using vvs = vector<vector<string>>;
using vvb = vector<vector<bool>>;
using pll = pair<ll, ll>;
using mll = map<ll, ll>;
const ll INF = 1LL << 60;
void in() {}
template <typename T, class... U>
void in(T &t, U &...u) {
  cin >> t;
  in(u...);
}
void out() { cout << endl; }
template <typename T, class... U>
void out(const T &t, const U &...u) {
  cout << t;
  if (sizeof...(u)) cout << " ";
  out(u...);
}
template <typename T>
void die(T x) {
  out(x);
  exit(0);
}
template <typename T>
void in1(T &s) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    in(s[i]);
  }
}
template <typename T>
void in2(T &s, T &t) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    in(s[i], t[i]);
  }
}
template <typename T>
void in3(T &s, T &t, T &u) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    in(s[i], t[i], u[i]);
  }
}
template <typename T>
void in4(T &s, T &t, T &u, T &v) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    in(s[i], t[i], u[i], v[i]);
  }
}
template <typename T>
void in5(T &s, T &t, T &u, T &v, T &w) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    in(s[i], t[i], u[i], v[i], w[i]);
  }
}
template <typename T>
void outv(T s) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    cout << s[i] << " ";
  }
  cout << endl;
}
template <typename T>
void out1(T s) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    out(s[i]);
  }
}
template <typename T>
void out2(T s, T t) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    out(s[i], t[i]);
  }
}
template <typename T>
void out3(T s, T t, T u) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    out(s[i], t[i], u[i]);
  }
}
template <typename T>
void out4(T s, T t, T u, T v) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    out(s[i], t[i], u[i], v[i]);
  }
}
template <typename T>
void out5(T s, T t, T u, T v, T w) {
  for (ll i = 0; i < (ll)s.size(); i++) {
    out(s[i], t[i], u[i], v[i], w[i]);
  }
}
template <typename T>
T allSum(vector<T> a) {
  T ans = T();
  for (auto &it : a) ans += it;
  return ans;
}
ll ceilDiv(ll a, ll b) { return (a + b - 1) / b; }
ld dist(pair<ld, ld> a, pair<ld, ld> b) {
  return sqrt(abs(a.first - b.first) * abs(a.first - b.first) +
              abs(a.second - b.second) * abs(a.second - b.second));
}
ll gcd(ll a, ll b) { return b != 0 ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <class A, class B>
inline bool chmax(A &a, const B &b) {
  return b > a && (a = b, true);
}
template <class A, class B>
inline bool chmin(A &a, const B &b) {
  return b < a && (a = b, true);
}
const int mod = 1000000007;
class mint {
  long long x;

 public:
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint &a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator-=(const mint &a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint &operator*=(const mint &a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint &a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint &a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint &a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint &a) { return (*this) *= a.inv(); }
  mint operator/(const mint &a) const {
    mint res(*this);
    return res /= a;
  }
  friend ostream &operator<<(ostream &os, const mint &m) {
    os << m.x;
    return os;
  }
};
class UnionFind {
 public:
  vector<ll> par;
  vector<ll> siz;
  UnionFind(ll N) : par(N), siz(N, 1LL) {
    for (int i = 0; i < N; i++) par[i] = i;
  }
  ll root(ll x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  bool unite(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool same(int x, int y) { return root(x) == root(y); }
  ll size(ll x) { return siz[root(x)]; }
};
class Dag {
 public:
  vvl g;
  vl inCnt;
  vl sorted;
  bool sortedF = false;
  Dag(ll N) : g(N), inCnt(N) {}
  void input(ll x, ll y) {
    g[x].push_back(y);
    inCnt[y]++;
  }
  bool tpSort() {
    vl tmp = inCnt;
    deque<ll> dq;
    vl ans;
    for (ll i = 0; i < (ll)g.size(); i++)
      if (tmp[i] == 0) dq.push_back(i);
    while (dq.size() != 0) {
      ll v = dq.front();
      dq.pop_front();
      ans.push_back(v);
      for (auto &it : g[v]) {
        tmp[it]--;
        if (tmp[it] == 0) dq.push_back(it);
      }
    }
    sorted.swap(ans);
    sortedF = true;
    return sorted.size() == g.size();
  }
  ll longest() {
    if (sortedF == false) tpSort();
    vl dp(g.size(), 0);
    ll res = 0;
    for (auto &it1 : sorted) {
      for (auto &it2 : g[it1]) {
        chmax(dp[it2], dp[it1] + 1);
      }
      chmax(res, dp[it1]);
    }
    return res;
  }
};
int main() {
  init();
  long long n;
  in(n);
  string s;
  in(s);
  bool f = false;
  ll ans = 0;
  for (ll i = 0; i < (ll)n; i++) {
    if (s[i] == '#') {
      f = true;
    }
    if (f == true && s[i] == '.') {
      ans++;
    }
  }
  out(ans);
  return 0;
}
