import sys,copy
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float('inf')
MOD = 10**9+7
dy = [0,1,0,-1]
dx = [1,0,-1,0]
ddy = [0,1,1,1,0,-1,-1,-1]
ddx = [1,1,0,-1,-1,-1,0,1]

n = int(input())
S = list(input())
T = copy.copy(S)
cnt = 0
for i in range(1,n):
    if S[i-1] == '#' and S[i] == '.':
        cnt += 1
        S[i] = '#'
tmp = 0
T = T[::-1]
for i in range(n-1):
    if T[i] == '.' and T[i+1] == '#':
        tmp += 1
        T[i+1] = '.'
#print(cnt,tmp)
print(min(cnt,tmp))