#include <bits/stdc++.h>
using namespace std;
const long long int logx = 30;
const long long int N = 2e5 + 1;
const long long int M = 2e5 + 5;
const long long int mod = 1e9 + 7;
const long long int INF = 1e18;
const double PI = 3.14159265358979323846;
inline long long int mul(long long int a, long long int b) {
  return (a * 1ll * b) % mod;
}
inline long long int sub(long long int a, long long int b) {
  long long int c = a - b;
  if (c < 0) c += mod;
  return c;
}
inline long long int add(long long int a, long long int b) {
  long long int c = a + b;
  if (c > mod) c -= mod;
  return c;
}
template <typename T>
T power(T x, T y, long long int m) {
  T ans = 1;
  while (y > 0) {
    if (y & 1LL) ans = (ans * x) % m;
    y >>= 1ll;
    x = (x * x) % m;
  }
  return ans % m;
}
long long int n;
string second;
long long int dp[N][2];
long long int F(long long int idx, long long int prev) {
  if (idx == n) {
    return 0;
  }
  if (dp[idx][prev] != -1) {
    return dp[idx][prev];
  }
  if (second[idx] == '.') {
    if (prev) {
      return dp[idx][prev] = 1 + F(idx + 1, 1);
    } else {
      return dp[idx][prev] = min(F(idx + 1, 0), 1 + F(idx + 1, 1));
    }
  } else {
    return dp[idx][prev] = min(1 + F(idx + 1, 0), F(idx + 1, 1));
  }
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> n >> second;
  cout << min((second[0] != '.') + F(1, 0), (second[0] != '#') + F(1, 1))
       << endl;
}
