#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int kx[] = {-1, 1, 2, 2, 1, -1, -2, -2};
const int ky[] = {2, 2, 1, -1, -2, -2, -1, 1};
string conv(int a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
string conv(char a) {
  stringstream ss;
  ss << a;
  string str = ss.str();
  return str;
}
int conv(string a) {
  stringstream geek(a);
  int x = 0;
  geek >> x;
  return x;
}
int main(void) {
  int n;
  cin >> n;
  string second;
  cin >> second;
  int a = 0, b = 0;
  int k = n - 1;
  for (int i = (n - 1); i >= (0); i--)
    if (second[i] == '#')
      k--;
    else
      break;
  n = k;
  for (int i = (0); i <= (k); i++) {
    if (second[i] == '.')
      a++;
    else
      b++;
  }
  cout << min(a, b);
  return 0;
}
