calculating total amount of edges