import copy
N = int(input())
S = input()
black_stone = S.count('#')
X = copy.copy(S)
num = 0

for i in range(N):
  if X[i] == '#' and X[i+1] == '.':
    num += 1
    X = X.replace(X[i],'#')
    
print(min(black_stone,num))
    