I have a dataset with data on exam results for students. There are 20+ subjects, of which a student chooses 9 subjects. The data set contains the grade for the subject they chose and missing values for the others. I want to create a new variable that indicates the combination of subjects that a particular student sat for in the exam. Any idea how to do that.

The data looks like this table below: in this case student 100 and 103 will have the same value for the new variable.
Student ID Math Eng Chem Bio French Accounting Literature economics
100 1 1 . . 2 2 1 .
101 1 1 2 2 . . . 1
103 1 4 . . 2 3 4
Thanks for any help