Using a simple one-dimensional Frenkel-Kontorowa type model, we have demonstrated that finite commensurate chains may undergo the commensurate-incommensurate (C-IC) transition when the chain is contaminated by isolated impurities attached to the chain ends. Monte Carlo (MC) simulation has shown that the same phenomenon appears in two-dimensional systems with impurities located at the peripheries of finite commensurate clusters.