#include <bits/stdc++.h>
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const long double PI = asin(1) * 2;
inline int sbt(int x) { return __builtin_popcount(x); }
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long SIZE = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  cin >> n >> s;
  int i = 0;
  for (; i < n; i++)
    if (s[i] == '#') break;
  int cnt1 = 0;
  for (; i < n; i++)
    if (s[i] == '.') cnt1++;
  int j = n - 1;
  int cnt2 = 0;
  for (; j >= 0; j--) {
    if (s[j] == '#') break;
    cnt2++;
  }
  for (; j >= 0; j--)
    if (j != 0 && s[j] == '.' && s[j - 1] == '#') cnt2++;
  cout << min(cnt1, cnt2);
  return 0;
}
