R is open source sfw, you can download it from its website:
www.cran.r-project.org
And for SAS the student edition is available free of cost, still i am not sure how you can get it. please contact your profs and lab instructors.
otherwise using torrent for SAS is not a bad idea, though it's your judgment call ;)
"Woh mara papad wale ko!"