You should start fasting with the community that you are in and end fasting with the community that you are in. It is possible that this means that you will fast 31 days. If that is the case then you fast 31 days. It is also possible that you will fast 28 days. If that is the case then you fast 28 days and make up an extra day later on. This is the opinion of the majority based on the hadith, "Your fast is the day the people fast and your breaking of fast is the day when the people break the fast."