# 
# Solution to Project Euler problem 53
# Philippe Legault
# 
# https://github.com/Bathlamos/Project-Euler-Solutions

from lib import primes_up_to
import itertools
from fractions import Fraction
from math import factorial


# Only <10K computations. No need for fancy logic
def compute():
	maximum = 100 # inclusive
	factorials = [factorial(n) for n in range(0, maximum + 1)]
	pairs =  [(i, j) for i, j in itertools.product(range(1, maximum + 1), repeat=2) if i > j]
	return len(filter(lambda x: factorials[x[0]] / (factorials[x[1]] * factorials[x[0] - x[1]]) > 1000000, pairs))


def digits(n):
	s = []
	while n != 0:
		s.append(n % 10)
		n /= 10
	s = sorted(s)
	return s


if __name__ == "__main__":
	print(compute())