A sharp bound for the minimal number of generators of perfect height two ideals