import os dir = os.path.dirname(os.path.abspath(__file__)) input_file = open(os.path.join(dir, './input.txt'), 'r') lines = input_file.readlines() last_depth = -1 count = 0 for line in lines: int_value = int(line) if last_depth == -1: last_depth = int_value continue if int_value > last_depth: count = count+1 last_depth = int_value print(count)