Solar activity is a space-time complex of events that are produced by Sun magnetic fields. One of the results of this activity are solar flares. The solar flares occurs mainly in the areas with especially strong magnetic fields called Active Regions (AR). Observation phenomenology indicates that significant change in the magnetic field topology precedes strong flares. Now high frequency temporal sequences of AR magnetograms containing flares are available from the space observatory Solar Dynamics Observatory (SDO). We analyzed them to investigate changes in complexity by using methods of computational topology. As possible descriptors of flares we used topological invariants: the Euler characteristics and Betti numbers. These characteristics of course do not pretend to be the comprehensive description of topological complexity but they are simple in construction and intuitively clear. We found that the large variation of the Betti numbers and Euler characteristics are preceded or accompanied by a large flares