How many pages have issues? At work I've been acting as quality control on our public documents, to make sure that they are WCAG 2.0 compliant. Given the length of some of these documents there tend to be issues, and so I record the issues and the pages they occur on. 

The challenge: Given a string input, output a count of all distinct pages within the string.

Rules:


Input will consist of of a non-empty string containing the pages, page ranges, and the issue. Multiple pages and page ranges are guaranteed to be separated by commas ,.


pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes


pgs 810-812,897,1043, 1047,1219, 1308, 1317, 1323 restructure reading boxes


Both of the above are possible valid inputs.


This input can be multiple lines, with each line representing a different issue.


pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes
pgs 816, 819, 826, 827, 829, 853, 861, 866, 885, 1043, 1142, 1143, 1164 table needs to be read as table or figure


You can take a multiline input as a list of strings, with each item in the list being a line. The output is still based on the entirety of the list.


The input format is not necessarily pgs &lt;page numbers&gt; &lt;issue&gt;.

Both pg 1324 read all and Read all are valid inputs. 

If the string consists of only &lt;Issue&gt;, this represents that the document is a single page, and thus the output would be 1 (no matter how many lines of input there are). If there is more than one page, you are guaranteed to not have this format as a line of the input.


Test Cases:

Input:
------
pgs 810-812, 897, 1043, 1047, 1219, 1308, 1317, 1323 restructure reading boxes

Output: 
-------
10


Input:
------
pgs 587,897, 936, 939,946, 1308 single figure
pgs 810-812, 897, 1043, 1047, 1219,1308,1317, 1323 restructure reading boxes

Output:
-------
14


Input:
------
pgs 824, 873, 941-943, 1032, 1034, 1036-1040, 1055, 1071, 1153, 1154, 1228 figures as figures
pgs 1036-1040 Color Contrast for negative balance numbers does not meet WGAC 2.0 guidelines
pg 1324 read all

Output:
-------
18

Input:
------
Incorrect Reading Order

Output:
-------
1

Input:
------
Incorrect Reading Order
Pg 1 Read Table as Table
Pgs 1 Color Contrast for negative balance numbers does not meet WGAC 2.0 guidelines

Output:
-------
1




This is code-golf, so shortest answer in bytes wins.
05AB1E, 51 38 bytes
-13 bytes thanks to Kevin Cruijssen!
',ð:#ʒ'-м€.ïß}D.ï≠ÅÏ'-¡¤LsнUʒX&lt;›]˜Ùg1M

Try it online!
Explanation
                                      // Implicitly Read in multiline string 
 ',ð:#                                //Swap commas with spaces and split on spaces
      ʒ'-м€.ïß}                       //Filter list to only those with - removed are numbers
               D                      //Duplicate
                .ï≠ÅÏ                 //For all the ones that aren't numbers (so the ranges)
                    '-¡               //Split on dashes
                       ¤L             //Generate list from 1 to the highest number
                         sнU          //Stick the lower number in the variable U
 ʒ®&lt;›]                                //Filter out numbers less than the lower number
      ˜                               //deep flatten
        Ùg                            //Uniquify and count 
          1M                          //Push 1 then output the largest number in the stack