I wish not to disturb your mind further ( :) ), ferrouslepidoptera, but there is more than meets the eye to the question how many melodies are there in the universe?. There are many, many more than one would expect.
For example, music is not limited to the diatonic system of the West. Oh, no, that would be far too easy. Arabic music has quarter tones, and some of their tones are off pitch to our western ears. Indian music... don't get me started. Chinese music is easy, and adds little to the list - it traditionally has five notes (which, I believe, mirror their five elements), which (I hope) use tones that us westerners adopted.
Oh, yeah, Western music has at least five different tunings, including but not limited to: Pure Major, Pure Minor, Pythagorean, Unequal Temperament and Equal Temperament.
Blues has blue notes, avant-garde music has cents (one hundredth of one whole tone, although the brain can only differentiate differences of only about a sixteenth of a note without difficulty), and the equation in the previous writeup does not address grace notes, mordents, trills, turns, and pitch bends, dynamics, tempo, timbre, modulation, nor almost any other fragment of music theory.
Music also has different segments to it, which can have an already-made melody in it without the song being called "plagarized". One can also have short snippets of melody, called riffs, which are not necessarily characeristic of a song, artist, nor style of music. Even music played in a different style of music can sound completely different, not to mention remixes.
Making an equation among these lines is nigh impossible, as even forgetting just one characteristic can throw off the equation by billions. I am confident to say that there are enough melodies in the world for my liking, perhaps infinite.
I realize that alternate tunings will not differentiate music much, but it can bring out character in songs and changes harmony in subtle ways.