From what I could tell with how it worked you seem to get it by being nice to all three animal girls however the bug one is hard to reach since the hospital part is so damn hard due to constant random encounters with enemies who drain your mp. The bosses there are damn tough too.
This isn't really a guide but it'll help you.
First things first sell guns whenever you get them they're worth tons (you can do so at the village vendor) and you want to save ap-resin for a special vendor that uses them as currency to get you the best armor called reinforced suit.
Use the money you get to buy the Masayuki -Zansetsu- sword it'll be the best you have until the dog girl gives you hers for saving her however don't bother going into the fight that leads to that until your confident you stand a chance. the boss I'm referring to has a huge axe so you'll recognize him he can one-shot (so use memory water to save beforehand hes in an area after the random "hand robots") you regardless of armor and level he needs to be silenced within the first two turns and then poisoned/toxic and even then you'll need even more luck since it does wear off eventually.
when you head to the underground of the village use the blue medicine to give yourself insomnia preventing the enemies from putting you to sleep.
Do the hospital last its the hardest and you want to collect ap-resin anyway. Progress through the city, village and church evenly at your leisure just don't use mp doing so unless you must, since it amounts to what your score will be and 10000 seems to be the requirement for A rank.
Lastly for the girl in the capsule to wake up, theres a note in the hospital mentioning her and when she goes hostile drain her mp not her health or shes perma dead.