When John gives his sister 1/4 of his money, he parts with 1/4*100 = <<1/4*100=25>>25 dollars
Johns remains with 100-25 = <<100-25=75>>75 dollars.
When he buys groceries worth $40, he remains with 75-40 = <<75-40=35>>35 dollars
#### 35