N = int(input())
S = input()

S = list(S)
white = S.copy()
black = S.copy()
ans1 = 0
ans2 = 0
# for i in range(N):
#     if i+1 < N:
#         if white[i] == '#' and white[i+1] == '.':
#             white[i+1] = '#'
#             ans1 += 1

# for i in range(N):
#     if i+1 < N:
#         if black[i] == '#' and black[i+1] == '.':
#             black[i] = '.'
#             ans2 += 1



# flag = 0
# flag = S.count('#')
# if flag > 0:
#     ans = S.count('.')
last_white = 0
last_white_flag = False
for i in range(N):
    if white[i] == '.':
        last_white_flag = True
        last_white = i
S = S[:last_white+1]
# print(S)
ans1 = S.count('#')
ans2 = S.count('.')

# print(S)
# print(ans1)
# print(ans2)
if ans1 < ans2:
    print(ans1)
else:
    print(ans2)