#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class T>
using V = vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) { return a / GCD(a, b) * b; }
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int ddx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
int ddy[8] = {0, -1, 0, 1, 1, -1, 1, -1};
char dir[4] = {'u', 'l', 'd', 'r'};
long long int cmp(pair<long long int, long long int> a,
                  pair<long long int, long long int> b) {
  if (a.second != b.second)
    return a.second < b.second;
  else
    return a.first < b.first;
}
struct unionfind {
  vector<int> rank, parent, size;
  unionfind(int n) {
    for (int i = 0; i < n; i++) {
      rank.push_back(1);
      parent.push_back(i);
      size.push_back(1);
    }
  }
  int getroot(int x) {
    if (parent[x] == x) return x;
    return parent[x] = getroot(parent[x]);
  }
  bool issame(int a, int b) { return getroot(a) == getroot(b); }
  void unite(int a, int b) {
    a = getroot(a);
    b = getroot(b);
    if (a == b)
      return;
    else if (rank[a] > rank[b]) {
      parent[b] = a;
      size[a] += size[b];
    } else if (rank[a] == rank[b]) {
      parent[b] = a;
      rank[a]++;
      size[a] += size[b];
    } else {
      parent[a] = b;
      size[b] += size[a];
    }
  }
};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int end = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      end = i;
      break;
    }
  }
  int start = 0;
  for (int i = 0; i <= end; i++) {
    if (s[i] == '#') {
      start = i;
      break;
    }
  }
  int b = 0, t = 0;
  for (int i = start; i <= end; i++) {
    if (s[i] == '#') b++;
    t++;
  }
  cout << (b < t - b ? b : t - b) << endl;
  return 0;
}
