
with open('index.php', 'r') as f:
    lines = f.readlines()

count = 0
for i, line in enumerate(lines[:1484]):
    count += line.count('<div')
    count -= line.count('</div')
    if count < 0:
        print(f"Error: more closing divs than opening divs at line {i+1}")
        count = 0

print(f"Final count at line 1484: {count}")
