The IF diet is a fad, and is not meant for long term use, so whatever weight you lose will most likely be gained back when you go off the diet.
Much better to make lifestyle changes that can be sustained over the long haul.
Never heard of the intermittent Fasting or IF-- look it up--- apparently people that go on this diet get fast results-- I'm on day one myself :)
20 lbs is too much to lose in 3 weeks, with safe weight loss being 1-2 pounds/week. Most likely if you're gaining weight, it's because you're building muscle from the exercise. Try taking your measurements and see if you've lost body mass, even if the scale went the wrong direction.
Your calorie intake is based on your age, height and current weight. If you like, I can help you calculate that.