#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <set>
#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define P pair<int, int>

#define MOD 1000000007
#define INF 2147483647
#define NINF (-2147483647-1)
#define LLINF 9223372036854775807
using ll = long long;
using namespace std;

int main() {
    int N;
    string S;
    cin >> N >> S;
    int cnt1 = 0, cnt2 = 0, cnt3 - 0;
    bool bla = true;
    for (int i = S.length()-1; i >= 0; i--)
    {
        if (S[i] == '.') {
            bla = false;
            cnt1++;
        }
        else if (S[i] == '#') {
            if (!bla) cnt2++;
            cnt3++;
        }
    }
    if (cnt2 == 0) {
        cout << min(cnt1, cnt3) << endl;
    }
    else {
        cout << min(cnt1, cnt2) << endl;
    }
    getchar(); getchar();
    return 0;
}