Sleeping i

i have new medication for my shin naproxen. was told i had to come of amertriptyline tablets my legs are aching a lot stopping me from sleeping, can i take both tablets