#!/usr/bin/env python
N = int(input())
S = input()

min = N
if S.count('#') == N or S.count('.') == N:
    print(0)
else:
    l = 0
    r = S.count('.')
    for n in range(1,N+1):
        if S[n-1] == '#':
            l += 1
        else:
            r -= 1
        if l+r < min:
            min = l+r
    print(min)