# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
input = sys.stdin.readline

# bisect_left(lists, 3)
# bisect_right(lists, 3)

def main():
	N = int(input())
	S = input()
	S = S[:-1]

	ans = 0
	flg = False
	for i in S:
		if i == "#":
			flg = True
			continue
		if flg == True and i == ".":
			ans += 1
			flg = False

	print(ans)

	

	
	
if __name__ == "__main__":
	main()
	