In DOS format they should be equal, in Unix format the number of carriage return should be 0. You'll need to find out what to do if:

the number of carriage returns is between 0 and the number of line breaks

the number of carriage returns is larger than the number of line breaks, with special subcase if the number of carriage returns is larger than 0 and the number of line breaks is 0 (basically an old Mac OS file)