Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n, m = map(int, input().split())
- a = []
- for i in range(n):
- a.append(list(input()))
- x = 0
- for i in range(n-1):
- for j in range(m-1):
- b = []
- b.append(a[i][j])
- b.append(a[i+1][j])
- b.append(a[i][j+1])
- b.append(a[i+1][j+1])
- if 'f' in b and 'a' in b and 'c' in b and 'e' in b:
- x += 1
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement