#A, B, C = map(int,input().split())


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

count=0
#for i in range(N-1):
#   if S[i] == "#" and S[i+1] == "." and S[i+2] == ".":
#       count += 1
#   if S[i] == "#" and S[i+1] == ".":
#       count += 1
#print(count)

i=0
while(i < N-1):
   if S[i] == "#" and S[i+1] == "." and S[i+2] == ".":
       count += 1
       i += 2
   elif S[i] == "#" and S[i+1] == "." and S[i+2] == "#":
       count += 1
       i += 2
   else:
       i += 1
print(count)