The Cubs’ game Tuesday was the beginning of manager Joe Maddon’s annual American Legion Week. Through this series against the Giants and the weekend set against the Nationals, Cubs players can come to the park whenever they think is best — as long as they’re ready to play.

‘‘The timing helps,’’ Maddon said. ‘‘August is just August. We’ve talked about it before. September provides its own energy. August, man, you’ve got to find it sometimes.’’

The Cubs found something during their 5-3 victory against the Giants.

Anthony Rizzo hit two home runs for his 17th career multihomer game. He has four homers in his last five games after hitting only two in the 50 games before that.

‘‘Just stay the course,’’ Rizzo said. ‘‘It’s a long season, and that’s what you lean on. If you start pressing to do things in this game, it usually hurts you.’’

Yes, it’s a long season, and maybe a few days of later arrivals and less work can’t hurt. Perhaps jokingly, Maddon estimated each Cubs player has taken at least 5,727 swings — and ‘‘maybe it’s 10,000.’’

‘‘You need to have that rested mind and body, so I think by picking this time of the year to do this, they show up a little bit later,’’ Maddon said. ‘‘They don’t feel compelled to do certain things that they feel like they may have to do to present the right image sometimes. A lot of this stuff is overplayed. A lot of it is eyewash. A lot of it’s there to ameliorate others’ concerns. Just do what’s necessary.’’

What’s necessary for the Cubs is beating out the Cardinals and fending off the Brewers in the National League Central while fixing their own issues. The bullpen has been trouble all season, winning series on the road have been rare and left-handed pitchers have given the lineup fits.

On Tuesday, the bullpen threw three scoreless innings and Craig Kimbrel picked up his first save since Aug. 3. One game after winning their first road series since May, the Cubs remained a half-game behind the Cardinals in the Central, thanks in part to another homer by Nick Castellanos, his seventh since being acquired from the Tigers.

‘‘Yeah, you could say rejuvenated,’’ said Castellanos, who had three hits. ‘‘Obviously, when you come from a team that the record is 30-70-whatever when I got traded to being in the middle of it is awesome.’’

Meanwhile, left-hander Cole Hamels allowed three runs in six innings, including homers to Austin Slater and Kevin Pillar. But he showed improvement from his last two starts, in which he allowed a combined 12 earned runs in five-plus innings, despite still struggling with his mechanics.

‘‘It’s kind of like when you have that golf swing, and you’re thinking about 10 different things and can’t hit the ball off the tee box,’’ Hamels said. ‘‘Luckily, I can get the ball off the tee box right now.’’

Playing golf might or might not be a part of American Legion Week, but Maddon said he thinks fatigue can spread to the mind. American Legion Week can help fix that.

‘‘When everybody’s mind’s fresher, you’re going to get a better product,’’ Maddon said. ‘‘I believe that.’’

Rizzo, who has been with the Cubs for all five of Maddon’s American Legion Weeks in Chicago, acknowledged the late arrivals can throw off some players’ routines. But he still thinks it’s helpful this late in the season.

‘‘It’s good timing,” he said. ‘‘It’s a good win.’’