#!/usr/bin/env python3 from sys import argv i = [x.strip() for x in open(argv[1])] h = len(i) w = len(i[0]) def f(dx, dy): x = ok = 0 for y in range(0, h, dy): if i[y][x%w] == "#": ok += 1 x += dx return ok print(f(3,1)) print(f(1,1)*f(3,1)*f(5,1)*f(7,1)*f(1,2))